From 9a0221255db4f50b3fa9a3bd288fdd2c22486a78 Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Wed, 5 Feb 2014 16:19:47 -0500 Subject: [PATCH 1/7] Backport the autoconf reorganization done for Project Asymptote. --- Makefile.in | 70 + clamav-config.h.in | 44 +- clamav-milter/Makefile.in | 70 + clambc/Makefile.in | 70 + clamconf/Makefile.in | 70 + clamd/Makefile.in | 70 + clamdscan/Makefile.in | 70 + clamdtop/Makefile.in | 70 + clamscan/Makefile.in | 70 + clamsubmit/Makefile.in | 70 + configure | 29329 ++++++++-------- configure.ac | 1770 +- database/Makefile.in | 70 + docs/Makefile.in | 70 + etc/Makefile.in | 70 + freshclam/Makefile.in | 70 + libclamav/Makefile.in | 70 + libltdl/Makefile.in | 70 + m4/reorganization/bigstack.m4 | 7 + m4/reorganization/bsd.m4 | 5 + m4/reorganization/build_tools.m4 | 7 + m4/reorganization/c_options.m4 | 6 + m4/reorganization/cfgdir.m4 | 17 + m4/reorganization/clamav_user.m4 | 57 + m4/reorganization/clamdtop.m4 | 48 + .../code_checks/compiler_attribs.m4 | 126 + m4/reorganization/code_checks/coverage.m4 | 22 + m4/reorganization/code_checks/ctime.m4 | 18 + m4/reorganization/code_checks/dns.m4 | 1 + m4/reorganization/code_checks/fanotify.m4 | 3 + m4/reorganization/code_checks/features.m4 | 1 + m4/reorganization/code_checks/functions.m4 | 13 + m4/reorganization/code_checks/iconv.m4 | 32 + m4/reorganization/code_checks/in_addr_t.m4 | 12 + m4/reorganization/code_checks/in_port_t.m4 | 12 + m4/reorganization/code_checks/ipv6.m4 | 39 + m4/reorganization/code_checks/mpool.m4 | 18 + m4/reorganization/code_checks/pthread_02.m4 | 11 + m4/reorganization/code_checks/pthreads.m4 | 3 + m4/reorganization/code_checks/readdir.m4 | 46 + m4/reorganization/code_checks/reentrant.m4 | 3 + m4/reorganization/code_checks/select.m4 | 52 + m4/reorganization/code_checks/setpgrp.m4 | 19 + m4/reorganization/code_checks/shift.m4 | 10 + m4/reorganization/code_checks/socklen_t.m4 | 41 + m4/reorganization/code_checks/stat64.m4 | 29 + m4/reorganization/code_checks/unit_tests.m4 | 21 + m4/reorganization/compiler_checks.m4 | 285 + m4/reorganization/customversion.m4 | 3 + m4/reorganization/dbdir.m4 | 18 + m4/reorganization/debug.m4 | 6 + m4/reorganization/distcheck.m4 | 22 + m4/reorganization/dns.m4 | 7 + m4/reorganization/headers.m4 | 10 + m4/reorganization/libs/bzip.m4 | 82 + m4/reorganization/libs/curl.m4 | 40 + m4/reorganization/libs/libconfig.m4 | 51 + m4/reorganization/libs/libz.m4 | 60 + m4/reorganization/libs/openssl.m4 | 37 + m4/reorganization/libs/unrar.m4 | 39 + m4/reorganization/libs/xml.m4 | 95 + m4/reorganization/linker_checks.m4 | 47 + m4/reorganization/llvm.m4 | 8 + m4/reorganization/milter/check.m4 | 29 + m4/reorganization/milter/enable.m4 | 3 + m4/reorganization/nocache.m4 | 8 + m4/reorganization/os_checks.m4 | 168 + m4/reorganization/sha_collect.m4 | 4 + m4/reorganization/substitutions.m4 | 24 + m4/reorganization/usergroup.m4 | 14 + m4/reorganization/utility_checks/id.m4 | 3 + m4/reorganization/utility_checks/yp.m4 | 3 + m4/reorganization/version.m4 | 17 + shared/Makefile.in | 192 +- sigtool/Makefile.in | 70 + sigtool/sigtool.c | 2 - test/Makefile.in | 70 + unit_tests/Makefile.in | 70 + 78 files changed, 18230 insertions(+), 16129 deletions(-) create mode 100644 m4/reorganization/bigstack.m4 create mode 100644 m4/reorganization/bsd.m4 create mode 100644 m4/reorganization/build_tools.m4 create mode 100644 m4/reorganization/c_options.m4 create mode 100644 m4/reorganization/cfgdir.m4 create mode 100644 m4/reorganization/clamav_user.m4 create mode 100644 m4/reorganization/clamdtop.m4 create mode 100644 m4/reorganization/code_checks/compiler_attribs.m4 create mode 100644 m4/reorganization/code_checks/coverage.m4 create mode 100644 m4/reorganization/code_checks/ctime.m4 create mode 100644 m4/reorganization/code_checks/dns.m4 create mode 100644 m4/reorganization/code_checks/fanotify.m4 create mode 100644 m4/reorganization/code_checks/features.m4 create mode 100644 m4/reorganization/code_checks/functions.m4 create mode 100644 m4/reorganization/code_checks/iconv.m4 create mode 100644 m4/reorganization/code_checks/in_addr_t.m4 create mode 100644 m4/reorganization/code_checks/in_port_t.m4 create mode 100644 m4/reorganization/code_checks/ipv6.m4 create mode 100644 m4/reorganization/code_checks/mpool.m4 create mode 100644 m4/reorganization/code_checks/pthread_02.m4 create mode 100644 m4/reorganization/code_checks/pthreads.m4 create mode 100644 m4/reorganization/code_checks/readdir.m4 create mode 100644 m4/reorganization/code_checks/reentrant.m4 create mode 100644 m4/reorganization/code_checks/select.m4 create mode 100644 m4/reorganization/code_checks/setpgrp.m4 create mode 100644 m4/reorganization/code_checks/shift.m4 create mode 100644 m4/reorganization/code_checks/socklen_t.m4 create mode 100644 m4/reorganization/code_checks/stat64.m4 create mode 100644 m4/reorganization/code_checks/unit_tests.m4 create mode 100644 m4/reorganization/compiler_checks.m4 create mode 100644 m4/reorganization/customversion.m4 create mode 100644 m4/reorganization/dbdir.m4 create mode 100644 m4/reorganization/debug.m4 create mode 100644 m4/reorganization/distcheck.m4 create mode 100644 m4/reorganization/dns.m4 create mode 100644 m4/reorganization/headers.m4 create mode 100644 m4/reorganization/libs/bzip.m4 create mode 100644 m4/reorganization/libs/curl.m4 create mode 100644 m4/reorganization/libs/libconfig.m4 create mode 100644 m4/reorganization/libs/libz.m4 create mode 100644 m4/reorganization/libs/openssl.m4 create mode 100644 m4/reorganization/libs/unrar.m4 create mode 100644 m4/reorganization/libs/xml.m4 create mode 100644 m4/reorganization/linker_checks.m4 create mode 100644 m4/reorganization/llvm.m4 create mode 100644 m4/reorganization/milter/check.m4 create mode 100644 m4/reorganization/milter/enable.m4 create mode 100644 m4/reorganization/nocache.m4 create mode 100644 m4/reorganization/os_checks.m4 create mode 100644 m4/reorganization/sha_collect.m4 create mode 100644 m4/reorganization/substitutions.m4 create mode 100644 m4/reorganization/usergroup.m4 create mode 100644 m4/reorganization/utility_checks/id.m4 create mode 100644 m4/reorganization/utility_checks/yp.m4 create mode 100644 m4/reorganization/version.m4 diff --git a/Makefile.in b/Makefile.in index 8d0b34866..65f061c2d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -103,6 +103,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -234,9 +288,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -256,6 +322,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -277,8 +344,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -316,6 +385,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clamav-config.h.in b/clamav-config.h.in index d08f30842..f8941a5e5 100644 --- a/clamav-config.h.in +++ b/clamav-config.h.in @@ -178,9 +178,6 @@ /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T -/* Define to 1 if you have the header file */ -#undef HAVE_FCNTL_H - /* have working file descriptor passing support */ #undef HAVE_FD_PASSING @@ -190,9 +187,6 @@ /* have getaddrinfo() */ #undef HAVE_GETADDRINFO -/* Define to 1 if you have the `getifaddrs' function. */ -#undef HAVE_GETIFADDRS - /* Define to 1 if getpagesize() is available */ #undef HAVE_GETPAGESIZE @@ -275,9 +269,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NDIR_H -/* Define to 1 if you have the header file */ -#undef HAVE_NET_IF_DL_H - /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR @@ -374,9 +365,6 @@ /* Define to 1 if sysconf(_SC_PAGESIZE) is available */ #undef HAVE_SYSCONF_SC_PAGESIZE -/* Define to 1 if you have the `sysctlbyname' function. */ -#undef HAVE_SYSCTLBYNAME - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H @@ -526,6 +514,28 @@ /* use syslog */ #undef USE_SYSLOG +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Version number of package */ #undef VERSION @@ -547,9 +557,19 @@ /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + /* POSIX compatibility */ #undef _POSIX_PII_SOCKET +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* thread safe */ #undef _REENTRANT diff --git a/clamav-milter/Makefile.in b/clamav-milter/Makefile.in index 17e48c875..f94e61f4b 100644 --- a/clamav-milter/Makefile.in +++ b/clamav-milter/Makefile.in @@ -85,6 +85,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -200,9 +254,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -222,6 +288,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -243,8 +310,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -282,6 +351,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clambc/Makefile.in b/clambc/Makefile.in index ba23f7262..cbc23f405 100644 --- a/clambc/Makefile.in +++ b/clambc/Makefile.in @@ -66,6 +66,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -136,9 +190,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -158,6 +224,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -179,8 +246,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -218,6 +287,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clamconf/Makefile.in b/clamconf/Makefile.in index 6ab1e5c66..17196e0a8 100644 --- a/clamconf/Makefile.in +++ b/clamconf/Makefile.in @@ -84,6 +84,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -154,9 +208,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -176,6 +242,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -197,8 +264,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -236,6 +305,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clamd/Makefile.in b/clamd/Makefile.in index c00dbbd76..4d42f16e7 100644 --- a/clamd/Makefile.in +++ b/clamd/Makefile.in @@ -84,6 +84,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -167,9 +221,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -189,6 +255,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -210,8 +277,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -249,6 +318,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clamdscan/Makefile.in b/clamdscan/Makefile.in index 9cc8ad351..38e06ba3d 100644 --- a/clamdscan/Makefile.in +++ b/clamdscan/Makefile.in @@ -84,6 +84,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -165,9 +219,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -187,6 +253,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -208,8 +275,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -247,6 +316,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clamdtop/Makefile.in b/clamdtop/Makefile.in index dc23f83a2..6672d5e07 100644 --- a/clamdtop/Makefile.in +++ b/clamdtop/Makefile.in @@ -66,6 +66,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -171,9 +225,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -193,6 +259,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -214,8 +281,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -253,6 +322,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clamscan/Makefile.in b/clamscan/Makefile.in index 2a350aa31..d6b94aa4f 100644 --- a/clamscan/Makefile.in +++ b/clamscan/Makefile.in @@ -85,6 +85,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -156,9 +210,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -178,6 +244,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -199,8 +266,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -238,6 +307,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/clamsubmit/Makefile.in b/clamsubmit/Makefile.in index ed0ddfc85..e7a835e85 100644 --- a/clamsubmit/Makefile.in +++ b/clamsubmit/Makefile.in @@ -84,6 +84,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -154,9 +208,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -176,6 +242,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -197,8 +264,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -236,6 +305,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/configure b/configure index 717c216e6..ca06a1e65 100755 --- a/configure +++ b/configure @@ -198,6 +198,7 @@ test -x / || exit 1" as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' @@ -205,8 +206,7 @@ test -x / || exit 1" ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else @@ -645,6 +645,33 @@ LTLIBOBJS LIBOBJS ENABLE_CLAMSUBMIT_FALSE ENABLE_CLAMSUBMIT_TRUE +CLAMBC_LIBS +CLAMDTOP_LIBS +THREAD_LIBS +TH_SAFE +CLAMDSCAN_LIBS +CLAMSCAN_LIBS +FRESHCLAM_LIBS +CLAMAV_MILTER_LIBS +CLAMMEM_LIBS +CLAMD_LIBS +LIBCLAMAV_LIBS +LIBCLAMSHARED_CPPFLAGS +CLAMBC_CPPFLAGS +CLAMDTOP_CPPFLAGS +CLAMCONF_CPPFLAGS +SIGTOOL_CPPFLAGS +LIBCLAMAV_CPPFLAGS +CLAMAV_MILTER_CPPFLAGS +CLAMMEM_CPPFLAGS +CLAMD_CPPFLAGS +CLAMDSCAN_CPPFLAGS +CLAMSCAN_CPPFLAGS +FRESHCLAM_CPPFLAGS +XML_LIBS +XML_CPPFLAGS +CLAMSUBMIT_CFLAGS +CLAMSUBMIT_LIBS subdirs WERR_CFLAGS_MILTER WERR_CFLAGS @@ -659,19 +686,8 @@ HAVE_MILTER_FALSE HAVE_MILTER_TRUE BUILD_CLAMD_FALSE BUILD_CLAMD_TRUE -CLAMSUBMIT_CFLAGS -CLAMSUBMIT_LIBS -THREAD_LIBS -TH_SAFE -CLAMDSCAN_LIBS -FRESHCLAM_LIBS -CLAMAV_MILTER_LIBS -CLAMD_LIBS -LIBCLAMAV_LIBS CFGDIR DBDIR -XML_LIBS -XML_CPPFLAGS ENABLE_UNRAR_FALSE ENABLE_UNRAR_TRUE HAVE_LIBBZ2_FALSE @@ -692,10 +708,10 @@ HAVE_LIBCHECK_TRUE CHECK_LIBS CHECK_CPPFLAGS BUILD_CONFIGURE_FLAGS -GPERF VERSIONSCRIPT_FALSE VERSIONSCRIPT_TRUE VERSIONSCRIPTFLAG +GPERF LIBM LTDLOPEN LT_CONFIG_H @@ -715,7 +731,6 @@ INCLTDL LTDLINCL LTDLDEPS LIBLTDL -CPP OTOOL64 OTOOL LIPO @@ -727,14 +742,19 @@ ac_ct_AR AR DLLTOOL OBJDUMP +LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP -EGREP -GREP SED +LIBTOOL +LIBCLAMAV_VERSION +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -745,20 +765,6 @@ AMDEP_TRUE am__quote am__include DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -LIBTOOL -LN_S -LIBCLAMAV_VERSION -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V am__untar am__tar AMTAR @@ -782,6 +788,16 @@ am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC target_os target_vendor target_cpu @@ -835,12 +851,12 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_dependency_tracking enable_silent_rules enable_static enable_shared with_pic enable_fast_install -enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock @@ -860,10 +876,7 @@ with_zlib enable_zlib_vcheck enable_bzip2 with_libbz2_prefix -with_libcurl enable_unrar -enable_xml -with_xml enable_getaddrinfo enable_ipv6 enable_dns @@ -876,8 +889,6 @@ enable_id_check enable_yp_check with_user with_group -enable_clamav -enable_debug with_version enable_no_cache enable_dns_fix @@ -891,6 +902,10 @@ with_libpdcurses_prefix enable_distcheck_werror enable_llvm enable_sha_collector_for_internal_use +with_libcurl +with_libconfig +enable_xml +with_xml ' ac_precious_vars='build_alias host_alias @@ -1521,14 +1536,14 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors --enable-silent-rules less verbose build output (undo: `make V=1') --disable-silent-rules verbose build output (undo: `make V=0') --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl --disable-gcc-vcheck do not check for buggy gcc version @@ -1541,8 +1556,7 @@ Optional Features: (and sometimes confusing) to the casual installer --disable-zlib-vcheck do not check for buggy zlib version --disable-bzip2 disable bzip2 support - --disable-unrar do not build libclamunrar and libclamunrar_iface - --disable-xml disable DMG and XAR support + --disable-unrar don't build libclamunrar and libclamunrar_iface --disable-getaddrinfo disable support for getaddrinfo --disable-ipv6 disable IPv6 support --disable-dns disable support for database verification through @@ -1550,11 +1564,9 @@ Optional Features: --disable-fanotify disable fanotify support (Linux only) --enable-milter build clamav-milter --disable-pthreads disable POSIX threads support - --disable-cr do not link with C reentrant library (BSD) + --disable-cr don't link with C reentrant library (BSD) --enable-id-check use id utility instead of /etc/passwd parsing --enable-yp-check use ypmatch utility instead of /etc/passwd parsing - --disable-clamav disable test for clamav user/group - --enable-debug enable debug code --enable-no-cache use "Cache-Control: no-cache" in freshclam --enable-dns-fix enable workaround for broken DNS servers (as in SpeedTouch 510) --enable-bigstack increase thread stack size @@ -1565,6 +1577,7 @@ Optional Features: enable warnings as error for distcheck [default=no] --enable-llvm Enable 'llvm' JIT/verifier support [default=auto] + --disable-xml disable DMG and XAR support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1584,10 +1597,6 @@ Optional Packages: /usr/local or /usr if not found in /usr/local) --with-libbz2-prefix[=DIR] search for libbz2 in DIR/include and DIR/lib --without-libbz2-prefix don't search for libbz2 in includedir and libdir - --with-libcurl=DIR path to directory containing libcurl (default= - /usr/local or /usr if not found in /usr/local) - --with-xml=DIR path to directory containing libxml2 library (default= - /usr/local or /usr if not found in /usr/local) --with-iconv supports iconv() (default=auto) --with-user=uid name of the clamav user (default=clamav) --with-group=gid name of the clamav group (default=clamav) @@ -1597,6 +1606,12 @@ Optional Packages: --without-libncurses-prefix don't search for libncurses in includedir and libdir --with-libpdcurses-prefix[=DIR] search for libpdcurses in DIR/include and DIR/lib --without-libpdcurses-prefix don't search for libpdcurses in includedir and libdir + --with-libcurl=DIR path to directory containing libcurl (default= + /usr/local or /usr if not found in /usr/local) + --with-libconfig=DIR path to directory containing libconfig (default= + /usr/local or /usr if not found in /usr/local) + --with-xml=DIR path to directory containing libxml2 library (default= + /usr/local or /usr if not found in /usr/local) Some influential environment variables: CC C compiler command @@ -1727,21 +1742,20 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" + if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 @@ -1749,97 +1763,112 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_link +} # ac_fn_c_try_cpp -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" + ac_header_compiler=yes else - eval "$3=no" + ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } -} # ac_fn_c_check_header_compile +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## -------------------------------------- ## +## Report this to http://bugs.clamav.net/ ## +## -------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval -} # ac_fn_c_try_cpp +} # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- @@ -1883,10 +1912,11 @@ fi } # ac_fn_c_try_run -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 @@ -1896,19 +1926,95 @@ if eval \${$3+:} false; then : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ +} # ac_fn_c_check_header_compile -#ifdef __STDC__ -# include -#else -# include +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include #endif #undef $2 @@ -2049,97 +2155,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## -------------------------------------- ## -## Report this to http://bugs.clamav.net/ ## -## -------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2826,208 +2841,61 @@ do done - -am__api_version='1.11' - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS -rm -rf conftest.one conftest.two conftest.dir - fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - - test "$2" = conftest.file - ) -then - # Ok. - : +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac fi - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3036,7 +2904,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" + ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3046,28 +2914,41 @@ IFS=$as_save_IFS fi fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3076,7 +2957,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" + ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3086,93 +2967,30 @@ IFS=$as_save_IFS fi fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else + ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do @@ -3180,7 +2998,11 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3188,2670 +3010,2075 @@ done done IFS=$as_save_IFS +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi fi fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" fi -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi + test -n "$CC" && break + done fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi -fi - - -# Define the identity of the package. - PACKAGE='clamav' - VERSION='devel' +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -# Some tools Automake needs. -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + test -n "$ac_ct_CC" && break +done + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} +fi -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 -$as_echo_n "checking how to create a ustar tar archive... " >&6; } -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar plaintar pax cpio none' -_am_tools=${am_cv_prog_tar_ustar-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - { echo "$as_me:$LINENO: $_am_tar --version" >&5 - ($_am_tar --version) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && break - done - am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x ustar -w "$$tardir"' - am__tar_='pax -L -x ustar -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H ustar -L' - am__tar_='find "$tardir" -print | cpio -o -H ustar -L' - am__untar='cpio -i -H ustar -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_ustar}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 - (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - rm -rf conftest.dir - if test -s conftest.tar; then - { echo "$as_me:$LINENO: $am__untar &5 - ($am__untar &5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - grep GrepMe conftest.dir/file >/dev/null 2>&1 && break - fi done -rm -rf conftest.dir +test "$ac_cv_exeext" = no && ac_cv_exeext= -if ${am_cv_prog_tar_ustar+:} false; then : - $as_echo_n "(cached) " >&6 else - am_cv_prog_tar_ustar=$_am_tool + ac_file='' fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 -$as_echo "$am_cv_prog_tar_ustar" >&6; } - - - - - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=0;; +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi -AM_BACKSLASH='\' - - - -$as_echo "#define PACKAGE PACKAGE_NAME" >>confdefs.h - - -VERSION="devel-`date +%Y%m%d`" +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } -LC_CURRENT=7 -LC_REVISION=19 -LC_AGE=1 -LIBCLAMAV_VERSION="$LC_CURRENT":"$LC_REVISION":"$LC_AGE" +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac done - done -IFS=$as_save_IFS +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ +#ifndef __GNUC__ + choke me +#endif -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + ac_compiler_gnu=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" + GCC= fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () { - $ECHO "" +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; } - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext - + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break fi + + done + ac_cv_prog_CPP=$CPP + fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + CPP=$ac_cv_prog_CPP else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_prog_CPP=$CPP fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi else - CC="$ac_cv_prog_CC" + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + done - done -IFS=$as_save_IFS +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done -IFS=$as_save_IFS + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_path_GREP=$GREP fi - fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done -IFS=$as_save_IFS + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_path_EGREP=$EGREP fi - - test -n "$CC" && break - done + fi fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_header_stdc=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include - test -n "$ac_ct_CC" && break -done +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi +else + ac_cv_header_stdc=no fi +rm -f conftest* fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done +else + ac_cv_header_stdc=no +fi +rm -f conftest* -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { - - ; + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; return 0; } _ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if ac_fn_c_try_run "$LINENO"; then : -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= +$as_echo "#define STDC_HEADERS 1" >>confdefs.h -else - ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac done + + + + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } + MINIX= fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } + if test "$MINIX" = yes; then -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h -int -main () -{ - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +# define __EXTENSIONS__ 1 + $ac_includes_default int main () { -#ifndef __GNUC__ - choke me -#endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes + ac_cv_safe_to_define___extensions__=yes else - ac_compiler_gnu=no + ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h -int -main () -{ + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h -int -main () -{ + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac -int -main () -{ + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install else - CFLAGS= + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -depcc="$CC" am_compiler_list= +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi - cd .. - rm -rf conftest.dir + test "$2" = conftest.file + ) +then + # Ok. + : else - am_cv_CC_dependencies_compiler_type=none + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - ac_cv_path_GREP=$GREP + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP + fi - fi + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -test -z "$GREP" && GREP=grep + test -n "$AWK" && break +done +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +DEPDIR="${am__leading_dot}deps" +ac_config_commands="$ac_config_commands depfiles" +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +# Define the identity of the package. + PACKAGE='clamav' + VERSION='devel' +# Some tools Automake needs. -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +$as_echo_n "checking how to create a ustar tar archive... " >&6; } +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' +_am_tools=${am_cv_prog_tar_ustar-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done - done -IFS=$as_save_IFS +rm -rf conftest.dir -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } +if ${am_cv_prog_tar_ustar+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi + am_cv_prog_tar_ustar=$_am_tool fi -test -z "$NM" && NM=nm - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +$as_echo "$am_cv_prog_tar_ustar" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +depcc="$CC" am_compiler_list= -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; + done - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset +case $enable_silent_rules in +yes) AM_DEFAULT_VERBOSITY=0;; +no) AM_DEFAULT_VERBOSITY=1;; +*) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 else - lt_unset=false + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' +$as_echo "#define PACKAGE PACKAGE_NAME" >>confdefs.h -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - +VERSION="devel-`date +%Y%m%d`" +LC_CURRENT=7 +LC_REVISION=11 +LC_AGE=1 +LIBCLAMAV_VERSION="$LC_CURRENT":"$LC_REVISION":"$LC_AGE" +cat >>confdefs.h <<_ACEOF +#define LIBCLAMAV_FULLVER "$major.$LC_AGE.$LC_REVISION" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define LIBCLAMAV_MAJORVER $major +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -fi -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF +cat >>confdefs.h <<_ACEOF +#define VERSION_SUFFIX "$VERSION_SUFFIX" +_ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -fi -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac +macro_version='2.4.2' +macro_revision='1.3337' -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi -test -z "$OBJDUMP" && OBJDUMP=objdump +ltmain="$ac_aux_dir/ltmain.sh" +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} -beos*) - lt_cv_deplibs_check_method=pass_all - ;; +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - +else + ac_cv_path_SED=$SED +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" @@ -5863,102 +5090,74 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done + $ac_path_FGREP_found && break 3 + done + done done IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_path_FGREP=$FGREP fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" -test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$GREP" && GREP=grep @@ -5968,37 +5167,8 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -6007,62 +5177,231 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - + with_gnu_ld=no fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld - test -n "$AR" && break + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" done + : ${lt_cv_path_NM=no} fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6071,7 +5410,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6081,21 +5420,21 @@ IFS=$as_save_IFS fi fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_AR" && break + test -n "$ac_ct_DUMPBIN" && break done - if test "x$ac_ct_AR" = x; then - AR="false" + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6103,174 +5442,374 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - AR=$ac_ct_AR + DUMPBIN=$ac_ct_DUMPBIN fi fi -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 else - archiver_list_spec=$lt_cv_ar_at_file -fi + i=0 + teststring="ABCD" + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } fi +max_cmd_len=$lt_cv_sys_max_cmd_len -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + fi - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; esac - STRIP=$ac_ct_STRIP - fi + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 else - STRIP="$ac_cv_prog_STRIP" + lt_cv_ld_reload_flag='-r' fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + -test -z "$STRIP" && STRIP=: @@ -6278,15 +5817,15 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : +if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6295,7 +5834,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6305,10 +5844,10 @@ IFS=$as_save_IFS fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6316,17 +5855,17 @@ fi fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6335,7 +5874,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" + ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6345,17 +5884,17 @@ IFS=$as_save_IFS fi fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6363,72 +5902,240 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - RANLIB=$ac_ct_RANLIB + OBJDUMP=$ac_ct_OBJDUMP fi else - RANLIB="$ac_cv_prog_RANLIB" + OBJDUMP="$ac_cv_prog_OBJDUMP" fi -test -z "$RANLIB" && RANLIB=: - - - +test -z "$OBJDUMP" && OBJDUMP=objdump -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; +beos*) + lt_cv_deplibs_check_method=pass_all + ;; +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -6438,265 +6145,112 @@ esac -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; +done + done +IFS=$as_save_IFS -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi done + done +IFS=$as_save_IFS fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" fi +test -z "$DLLTOOL" && DLLTOOL=dlltool @@ -6707,8 +6261,37 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -6716,266 +6299,187 @@ fi +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - with_sysroot=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac + AR=$ac_ct_AR + fi +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } +: ${AR=ar} +: ${AR_FLAGS=cru} -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + archiver_list_spec=$lt_cv_ar_at_file +fi + - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac -need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : +if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6984,7 +6488,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6994,10 +6498,10 @@ IFS=$as_save_IFS fi fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7005,17 +6509,17 @@ fi fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7024,7 +6528,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7034,17 +6538,17 @@ IFS=$as_save_IFS fi fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" + if test "x$ac_ct_STRIP" = x; then + STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7052,50 +6556,29 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + STRIP=$ac_ct_STRIP fi else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" + STRIP="$ac_cv_prog_STRIP" fi -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi +test -z "$STRIP" && STRIP=: - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7104,7 +6587,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7114,10 +6597,10 @@ IFS=$as_save_IFS fi fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -7125,17 +6608,17 @@ fi fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -7144,7 +6627,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7154,17 +6637,17 @@ IFS=$as_save_IFS fi fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7172,379 +6655,57 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DSYMUTIL=$ac_ct_DSYMUTIL + RANLIB=$ac_ct_RANLIB fi else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" + RANLIB="$ac_cv_prog_RANLIB" fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +test -z "$RANLIB" && RANLIB=: -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi @@ -7569,455 +6730,279 @@ fi +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +# Allow CC to be a program name with arguments. +compiler=$CC - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do - done - ac_cv_prog_CPP=$CPP + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext + # Check to see that the pipe works correctly. + pipe_works=no - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#ifdef __cplusplus +extern "C" { +#endif +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include + cat <<_LT_EOF >> conftest.$ac_ext -int -main () +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = { + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; - ; - return 0; +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; } -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +#endif -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done -else - ac_cv_header_stdc=no fi -rm -f conftest* +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } else - ac_cv_header_stdc=no -fi -rm -f conftest* - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF -fi -done -# Set options -enable_dlopen=yes -# Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=no -fi @@ -8029,1058 +7014,1070 @@ fi - enable_win32_dll=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; else - enable_shared=yes + with_sysroot=no fi +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; fi +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac +need_locks="$enable_libtool_lock" +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* fi -rmdir .libs 2>/dev/null +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes +done + done +IFS=$as_save_IFS -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi +IFS=$as_save_IFS -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi +IFS=$as_save_IFS -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" else - MAGIC_CMD=: + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT fi +else + NMEDIT="$ac_cv_prog_NMEDIT" fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - ;; -esac +done + done +IFS=$as_save_IFS -# Use C for the default configuration in the libtool script +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -lt_prog_compiler_no_builtin_flag= +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } else - : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +int +main () +{ -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no + lt_cv_ld_exported_symbols_list=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 +# Set options +enable_dlopen=yes +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + enable_static=no +fi - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi + + + + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac else - need_locks=no + enable_shared=yes fi @@ -9088,1299 +8085,365 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; - esac - ld_shlibs=yes - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; esac - fi +else + pic_mode=default +fi - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac +test -z "$pic_mode" && pic_mode=default - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. -_LT_EOF - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" ;; + esac +else + enable_fast_install=yes +fi - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - link_all_deplibs=no - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi -fi - aix_libpath=$lt_cv_aix_libpath_ -fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi -fi - aix_libpath=$lt_cv_aix_libpath_ -fi - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - darwin* | rhapsody*) - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - else - ld_shlibs=no - fi +test -z "$LN_S" && LN_S="ln -s" - ;; - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs else - lt_cv_irix_exported_symbol=no + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" +rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - *nto* | *qnx*) - ;; - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; +# Global variables: +ofile=libtool +can_build_shared=yes - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; +with_gnu_ld="$lt_cv_prog_gnu_ld" - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' +old_CC="$CC" +old_CFLAGS="$CFLAGS" - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 - *) - ld_shlibs=no - ;; - esac +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac +_LT_EOF + fi ;; + esac + fi + break fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + else + MAGIC_CMD=: + fi +fi + fi + ;; +esac +# Use C for the default configuration in the libtool script +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Source file extension for C test sources. +ac_ext=c +# Object file extension for compiled C test sources. +objext=o +objext=$objext +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' @@ -10388,62 +8451,475 @@ esac +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +# Allow CC to be a program name with arguments. +compiler=$CC +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then +lt_prog_compiler_no_builtin_flag= +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi +fi + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi +fi @@ -10455,8 +8931,46 @@ esac +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi @@ -10464,823 +8978,1303 @@ esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no ;; esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; + ld_shlibs=yes -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + # See if GNU ld supports shared libraries. case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ld_shlibs=no fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") ;; - esac - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; -int -main () -{ + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac -fi + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; +int +main () +{ -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" fi - ;; -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; +fi -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; + aix_libpath=$lt_cv_aix_libpath_ +fi -rdos*) - dynamic_linker=no - ;; + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +int +main () +{ -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + aix_libpath=$lt_cv_aix_libpath_ fi + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + darwin* | rhapsody*) + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + else + ld_shlibs=no + fi + ;; + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + *) + ld_shlibs=no + ;; + esac + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no +with_gnu_ld=$with_gnu_ld @@ -11296,9 +10290,74 @@ fi +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac @@ -11325,553 +10384,42 @@ fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi -fi -fi -fi - ;; - esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" -#if HAVE_DLFCN_H -#include -#endif -#include -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" -#if HAVE_DLFCN_H -#include -#endif -#include -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi @@ -11889,35 +10437,6 @@ fi -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi @@ -11930,54 +10449,15 @@ fi - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC="$lt_save_CC" @@ -11993,799 +10473,811 @@ CC="$lt_save_CC" - ac_config_commands="$ac_config_commands libtool" -# Only expand once: -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 -$as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } -if ${libltdl_cv_shlibext+:} false; then : - $as_echo_n "(cached) " >&6 -else - -module=yes -eval libltdl_cv_shlibext=$shrext_cmds -module=no -eval libltdl_cv_shrext=$shrext_cmds - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 -$as_echo "$libltdl_cv_shlibext" >&6; } -if test -n "$libltdl_cv_shlibext"; then - -cat >>confdefs.h <<_ACEOF -#define LT_MODULE_EXT "$libltdl_cv_shlibext" -_ACEOF - -fi -if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then - -cat >>confdefs.h <<_ACEOF -#define LT_SHARED_EXT "$libltdl_cv_shrext" -_ACEOF - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 -$as_echo_n "checking which variable specifies run-time module search path... " >&6; } -if ${lt_cv_module_path_var+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_module_path_var="$shlibpath_var" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 -$as_echo "$lt_cv_module_path_var" >&6; } -if test -n "$lt_cv_module_path_var"; then - -cat >>confdefs.h <<_ACEOF -#define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" -_ACEOF -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 -$as_echo_n "checking for the default library search path... " >&6; } -if ${lt_cv_sys_dlsearch_path+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 -$as_echo "$lt_cv_sys_dlsearch_path" >&6; } -if test -n "$lt_cv_sys_dlsearch_path"; then - sys_dlsearch_path= - for dir in $lt_cv_sys_dlsearch_path; do - if test -z "$sys_dlsearch_path"; then - sys_dlsearch_path="$dir" - else - sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" - fi - done -cat >>confdefs.h <<_ACEOF -#define LT_DLSEARCH_PATH "$sys_dlsearch_path" -_ACEOF -fi -LT_DLLOADERS= -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -LIBADD_DLOPEN= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if ${ac_cv_search_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlopen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_dlopen+:} false; then : - break -fi -done -if ${ac_cv_search_dlopen+:} false; then : -else - ac_cv_search_dlopen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -$as_echo "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -$as_echo "#define HAVE_LIBDL 1" >>confdefs.h - if test "$ac_cv_search_dlopen" != "none required" ; then - LIBADD_DLOPEN="-ldl" - fi - libltdl_cv_lib_dl_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if HAVE_DLFCN_H -# include -#endif -int -main () -{ -dlopen(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define HAVE_LIBDL 1" >>confdefs.h - libltdl_cv_func_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : -$as_echo "#define HAVE_LIBDL 1" >>confdefs.h - LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes -then - lt_save_LIBS="$LIBS" - LIBS="$LIBS $LIBADD_DLOPEN" - for ac_func in dlerror -do : - ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" -if test "x$ac_cv_func_dlerror" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLERROR 1 -_ACEOF -fi -done - LIBS="$lt_save_LIBS" -fi -LIBADD_SHL_LOAD= -ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : -$as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : -$as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" - LIBADD_SHL_LOAD="-ldld" -fi - -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown case $host_os in -darwin[1567].*) -# We only want this for pre-Mac OS X 10.4. - ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" -if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH -$as_echo "#define HAVE_DYLD 1" >>confdefs.h + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" -fi +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac ;; + beos*) - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH ;; -cygwin* | mingw* | os2* | pw32*) - ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include -" -if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl -_ACEOF - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - -$as_echo "#define HAVE_DLD 1" >>confdefs.h - - LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" -fi +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' -LT_DLPREOPEN= -if test -n "$LT_DLLOADERS" -then - for lt_loader in $LT_DLLOADERS; do - LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " - done + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; -$as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' -fi + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; -LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 -$as_echo_n "checking for _ prefix in compiled symbols... " >&6; } -if ${lt_cv_sys_symbol_underscore+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sys_symbol_underscore=no - cat > conftest.$ac_ext <<_LT_EOF -void nm_test_func(){} -int main(){nm_test_func;return 0;} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - ac_nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$ac_nlist"; then - # See whether the symbols have a leading underscore. - if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then - lt_cv_sys_symbol_underscore=yes - else - if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then - : - else - echo "configure: cannot find nm_test_func in $ac_nlist" >&5 - fi - fi - else - echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` else - echo "configure: failed program was:" >&5 - cat conftest.c >&5 + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac fi - rm -rf conftest* + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 -$as_echo "$lt_cv_sys_symbol_underscore" >&6; } - sys_symbol_underscore=$lt_cv_sys_symbol_underscore +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; -if test x"$lt_cv_sys_symbol_underscore" = xyes; then - if test x"$libltdl_cv_func_dlopen" = xyes || - test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 -$as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } -if ${libltdl_cv_need_uscore+:} false; then : - $as_echo_n "(cached) " >&6 -else - libltdl_cv_need_uscore=unknown - save_LIBS="$LIBS" - LIBS="$LIBS $LIBADD_DLOPEN" - if test "$cross_compiling" = yes; then : - libltdl_cv_need_uscore=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -#include +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -int fnord () { return 42; } -int main () +int +main () { - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - return status; + ; + return 0; } -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; - x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; - x$lt_dlunknown|x*) ;; - esac - else : - # compilation failed +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir - fi fi -rm -fr conftest* - LIBS="$save_LIBS" + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 -$as_echo "$libltdl_cv_need_uscore" >&6; } + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi -fi -if test x"$libltdl_cv_need_uscore" = xyes; then + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; -$as_echo "#define NEED_USCORE 1" >>confdefs.h +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; -fi +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 -$as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } -if ${lt_cv_sys_dlopen_deplibs+:} false; then : - $as_echo_n "(cached) " >&6 -else - # PORTME does your system automatically load deplibs for dlopen? - # or its logical equivalent (e.g. shl_load for HP-UX < 11) - # For now, we just catch OSes we know something about -- in the - # future, we'll try test this programmatically. - lt_cv_sys_dlopen_deplibs=unknown - case $host_os in - aix3*|aix4.1.*|aix4.2.*) - # Unknown whether this is true for these versions of AIX, but - # we want this `case' here to explicitly catch those versions. - lt_cv_sys_dlopen_deplibs=unknown - ;; - aix[4-9]*) - lt_cv_sys_dlopen_deplibs=yes - ;; - amigaos*) - case $host_cpu in - powerpc) - lt_cv_sys_dlopen_deplibs=no - ;; - esac - ;; - darwin*) - # Assuming the user has installed a libdl from somewhere, this is true - # If you are looking for one http://www.opendarwin.org/projects/dlcompat - lt_cv_sys_dlopen_deplibs=yes - ;; - freebsd* | dragonfly*) - lt_cv_sys_dlopen_deplibs=yes - ;; - gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) - # GNU and its variants, using gnu ld.so (Glibc) - lt_cv_sys_dlopen_deplibs=yes - ;; - hpux10*|hpux11*) - lt_cv_sys_dlopen_deplibs=yes - ;; - interix*) - lt_cv_sys_dlopen_deplibs=yes - ;; - irix[12345]*|irix6.[01]*) - # Catch all versions of IRIX before 6.2, and indicate that we don't - # know how it worked for any of those versions. - lt_cv_sys_dlopen_deplibs=unknown - ;; - irix*) - # The case above catches anything before 6.2, and it's known that - # at 6.2 and later dlopen does load deplibs. - lt_cv_sys_dlopen_deplibs=yes - ;; - netbsd* | netbsdelf*-gnu) - lt_cv_sys_dlopen_deplibs=yes - ;; - openbsd*) - lt_cv_sys_dlopen_deplibs=yes - ;; - osf[1234]*) - # dlopen did load deplibs (at least at 4.x), but until the 5.x series, - # it did *not* use an RPATH in a shared library to find objects the - # library depends on, so we explicitly say `no'. - lt_cv_sys_dlopen_deplibs=no - ;; - osf5.0|osf5.0a|osf5.1) - # dlopen *does* load deplibs and with the right loader patch applied - # it even uses RPATH in a shared library to search for shared objects - # that the library depends on, but there's no easy way to know if that - # patch is installed. Since this is the case, all we can really - # say is unknown -- it depends on the patch being installed. If - # it is, this changes to `yes'. Without it, it would be `no'. - lt_cv_sys_dlopen_deplibs=unknown - ;; - osf*) - # the two cases above should catch all versions of osf <= 5.1. Read - # the comments above for what we know about them. - # At > 5.1, deplibs are loaded *and* any RPATH in a shared library - # is used to find them so we can finally say `yes'. - lt_cv_sys_dlopen_deplibs=yes - ;; - qnx*) - lt_cv_sys_dlopen_deplibs=yes - ;; - solaris*) - lt_cv_sys_dlopen_deplibs=yes - ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - libltdl_cv_sys_dlopen_deplibs=yes - ;; - esac +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 -$as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } -if test "$lt_cv_sys_dlopen_deplibs" != yes; then +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; -$as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; -fi +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; -: +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; -for ac_header in argz.h -do : - ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default -" -if test "x$ac_cv_header_argz_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ARGZ_H 1 -_ACEOF +rdos*) + dynamic_linker=no + ;; -fi +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; -done +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; -ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) -# include -#endif -" -if test "x$ac_cv_type_error_t" = xyes; then : +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; -cat >>confdefs.h <<_ACEOF -#define HAVE_ERROR_T 1 -_ACEOF +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -else +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -$as_echo "#define error_t int" >>confdefs.h +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi -$as_echo "#define __error_t_defined 1" >>confdefs.h - +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi -ARGZ_H= -for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ - argz_next argz_stringify -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -else - ARGZ_H=argz.h; - _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" -fi -done -if test -z "$ARGZ_H"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 -$as_echo_n "checking if argz actually works... " >&6; } -if ${lt_cv_sys_argz_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host_os in #( - *cygwin*) - lt_cv_sys_argz_works=no - if test "$cross_compiling" != no; then - lt_cv_sys_argz_works="guessing no" - else - lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' - save_IFS=$IFS - IFS=-. - set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` - IFS=$save_IFS - lt_os_major=${2-0} - lt_os_minor=${3-0} - lt_os_micro=${4-0} - if test "$lt_os_major" -gt 1 \ - || { test "$lt_os_major" -eq 1 \ - && { test "$lt_os_minor" -gt 5 \ - || { test "$lt_os_minor" -eq 5 \ - && test "$lt_os_micro" -gt 24; }; }; }; then - lt_cv_sys_argz_works=yes - fi - fi - ;; #( - *) lt_cv_sys_argz_works=yes ;; - esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 -$as_echo "$lt_cv_sys_argz_works" >&6; } - if test "$lt_cv_sys_argz_works" = yes; then : -$as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h -else - ARGZ_H=argz.h - _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 -$as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } -if ${libltdl_cv_preloaded_symbols+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$lt_cv_sys_global_symbol_pipe"; then - libltdl_cv_preloaded_symbols=yes - else - libltdl_cv_preloaded_symbols=no - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 -$as_echo "$libltdl_cv_preloaded_symbols" >&6; } -if test x"$libltdl_cv_preloaded_symbols" = xyes; then -$as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h -fi -# Set options @@ -12797,269 +11289,60 @@ fi -# Check whether --with-included_ltdl was given. -if test "${with_included_ltdl+set}" = set; then : - withval=$with_included_ltdl; -fi -if test "x$with_included_ltdl" != xyes; then - # We are not being forced to use the included libltdl sources, so - # decide whether there is a useful installed version we can use. - ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default -" -if test "x$ac_cv_header_ltdl_h" = xyes; then : - ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default - #include -" -if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 -$as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; } -if ${ac_cv_lib_ltdl_lt_dladvise_preload+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lltdl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char lt_dladvise_preload (); -int -main () -{ -return lt_dladvise_preload (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ltdl_lt_dladvise_preload=yes -else - ac_cv_lib_ltdl_lt_dladvise_preload=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5 -$as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } -if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes; then : - with_included_ltdl=no -else - with_included_ltdl=yes -fi -else - with_included_ltdl=yes -fi -else - with_included_ltdl=yes -fi -fi -# Check whether --with-ltdl_include was given. -if test "${with_ltdl_include+set}" = set; then : - withval=$with_ltdl_include; -fi -if test -n "$with_ltdl_include"; then - if test -f "$with_ltdl_include/ltdl.h"; then : - else - as_fn_error $? "invalid ltdl include directory: \`$with_ltdl_include'" "$LINENO" 5 - fi -else - with_ltdl_include=no -fi -# Check whether --with-ltdl_lib was given. -if test "${with_ltdl_lib+set}" = set; then : - withval=$with_ltdl_lib; -fi -if test -n "$with_ltdl_lib"; then - if test -f "$with_ltdl_lib/libltdl.la"; then : - else - as_fn_error $? "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5 - fi -else - with_ltdl_lib=no -fi -case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in - ,yes,no,no,) - case $enable_ltdl_convenience in - no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; -esac -LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" -LTDLDEPS=$LIBLTDL -LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" -# For backwards non-gettext consistent compatibility... -INCLTDL="$LTDLINCL" - ;; - ,no,no,no,) - # If the included ltdl is not to be used, then use the - # preinstalled libltdl we found. -$as_echo "#define HAVE_LTDL 1" >>confdefs.h - LIBLTDL=-lltdl - LTDLDEPS= - LTDLINCL= - ;; - ,no*,no,*) - as_fn_error $? "\`--with-ltdl-include' and \`--with-ltdl-lib' options must be used together" "$LINENO" 5 - ;; - *) with_included_ltdl=no - LIBLTDL="-L$with_ltdl_lib -lltdl" - LTDLDEPS= - LTDLINCL="-I$with_ltdl_include" - ;; -esac -INCLTDL="$LTDLINCL" -# Report our decision... -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 -$as_echo_n "checking where to find libltdl headers... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 -$as_echo "$LTDLINCL" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 -$as_echo_n "checking where to find libltdl library... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 -$as_echo "$LIBLTDL" >&6; } -# Check whether --enable-ltdl-install was given. -if test "${enable_ltdl_install+set}" = set; then : - enableval=$enable_ltdl_install; -fi -case ,${enable_ltdl_install},${enable_ltdl_convenience} in - *yes*) ;; - *) enable_ltdl_convenience=yes ;; -esac - if test x"${enable_ltdl_install-no}" != xno; then - INSTALL_LTDL_TRUE= - INSTALL_LTDL_FALSE='#' -else - INSTALL_LTDL_TRUE='#' - INSTALL_LTDL_FALSE= -fi - if test x"${enable_ltdl_convenience-no}" != xno; then - CONVENIENCE_LTDL_TRUE= - CONVENIENCE_LTDL_FALSE='#' -else - CONVENIENCE_LTDL_TRUE='#' - CONVENIENCE_LTDL_FALSE= -fi -# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS -# the user used. This is so that ltdl.h can pick up the parent projects -# config.h file, The first file in AC_CONFIG_HEADERS must contain the -# definitions required by ltdl.c. -# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). -for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done -for ac_func in closedir opendir readdir -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF -else - _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" -fi -done -for ac_func in strlcat strlcpy -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - - - _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" - -fi -done - - - -cat >>confdefs.h <<_ACEOF -#define LT_LIBEXT "$libext" -_ACEOF - - -name= -eval "lt_libprefix=\"$libname_spec\"" - -cat >>confdefs.h <<_ACEOF -#define LT_LIBPREFIX "$lt_libprefix" -_ACEOF - - -name=ltdl -eval "LTDLOPEN=\"$libname_spec\"" @@ -13068,1472 +11351,1010 @@ eval "LTDLOPEN=\"$libname_spec\"" -# Only expand once: - - -ac_config_files="$ac_config_files libltdl/Makefile" - - -major=`expr $LC_CURRENT - $LC_AGE` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then -cat >>confdefs.h <<_ACEOF -#define LIBCLAMAV_FULLVER "$major.$LC_AGE.$LC_REVISION" -_ACEOF + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi -cat >>confdefs.h <<_ACEOF -#define LIBCLAMAV_MAJORVER $major -_ACEOF -$as_echo "#define SCANBUFF 131072" >>confdefs.h -$as_echo "#define FILEBUFF 8192" >>confdefs.h + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; - # Only modify libdir if user has not overriden it - default_libdir='${exec_prefix}/lib' - if test "$libdir" = "$default_libdir"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multiarch libdir" >&5 -$as_echo_n "checking for multiarch libdir... " >&6; } - # Based on http://lists.gnu.org/archive/html/autoconf/2008-09/msg00072.html - if test "$GCC" = yes; then - ac_multilibdir=`$CC -print-multi-os-directory $CFLAGS $CPPFLAGS $LDFLAGS` || ac_multilibdir=. - else - ac_multilibdir=. - fi - case "$ac_multilibdir" in - # I don't know if the first two cases can happen, but it would be a - # bad idea to override $exec_prefix - /* | ../../* | .) acl_libdirstem=lib ;; - ../*) acl_libdirstem=`echo $ac_multilibdir | sed 's/^...//' ` ;; - *) acl_libdirstem=lib/$ac_multilibdir ;; - esac - libdir='${exec_prefix}/'$acl_libdirstem - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libdir" >&5 -$as_echo "$libdir" >&6; } - else - acl_libdirstem=lib - if test -d "$libdir"; then - case "$libdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - *) searchdir=`cd "$libdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac - esac - fi - fi + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); int main () { - +return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes else - ac_cv_header_stdc=no + ac_cv_lib_dl_dlopen=no fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes -else - ac_cv_header_stdc=no fi -rm -f conftest* -fi + ;; -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); int main () { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; +return shl_load (); + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes else - ac_cv_header_stdc=no + ac_cv_lib_dld_shl_load=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 -$as_echo_n "checking for C/C++ restrict keyword... " >&6; } -if ${ac_cv_c_restrict+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_restrict=no - # The order here caters to the fact that C++ does not require restrict. - for ac_kw in __restrict __restrict__ _Restrict restrict; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -typedef int * int_ptr; - int foo (int_ptr $ac_kw ip) { - return ip[0]; - } + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); int main () { -int s[1]; - int * $ac_kw t = s; - t[0] = 0; - return foo(t) +return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_restrict=$ac_kw +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_restrict" != no && break - done - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 -$as_echo "$ac_cv_c_restrict" >&6; } - - case $ac_cv_c_restrict in - restrict) ;; - no) $as_echo "#define restrict /**/" >>confdefs.h - ;; - *) cat >>confdefs.h <<_ACEOF -#define restrict $ac_cv_c_restrict -_ACEOF - ;; - esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); int main () { - -#ifndef __cplusplus - /* Ultrix mips cc rejects this sort of thing. */ - typedef int charset[2]; - const charset cs = { 0, 0 }; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this sort of thing. */ - char tx; - char *t = &tx; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; } bx; - struct s *b = &bx; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - +return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes else - ac_cv_c_const=no + ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done + + +fi + + +fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF ;; -esac + 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 : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif +#if HAVE_DLFCN_H +#include +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +#include -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif -int -main () +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; - ; - return 0; + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; } -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -fr conftest* + + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); - ; - return 0; + return status; } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi fi +rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 -$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } -if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmw $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char _mwvalidcheckl (); -int -main () -{ -return _mwvalidcheckl (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_mw__mwvalidcheckl=yes -else - ac_cv_lib_mw__mwvalidcheckl=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 -$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } -if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : - LIBM="-lmw" -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 -$as_echo_n "checking for cos in -lm... " >&6; } -if ${ac_cv_lib_m_cos+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char cos (); -int -main () -{ -return cos (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_cos=yes -else - ac_cv_lib_m_cos=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 -$as_echo "$ac_cv_lib_m_cos" >&6; } -if test "x$ac_cv_lib_m_cos" = xyes; then : - LIBM="$LIBM -lm" -fi - ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 -$as_echo_n "checking for cos in -lm... " >&6; } -if ${ac_cv_lib_m_cos+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char cos (); -int -main () -{ -return cos (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_cos=yes -else - ac_cv_lib_m_cos=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 -$as_echo "$ac_cv_lib_m_cos" >&6; } -if test "x$ac_cv_lib_m_cos" = xyes; then : - LIBM="-lm" -fi - ;; -esac -# Check whether --enable-gcc-vcheck was given. -if test "${enable_gcc_vcheck+set}" = set; then : - enableval=$enable_gcc_vcheck; gcc_check=$enableval -else - gcc_check="yes" -fi -msg_gcc_check="use --disable-gcc-vcheck to disable this check. Before reporting any bugs check with a supported version of gcc" -VERSION_SUFFIX= -if test "$gcc_check" = "yes"; then - if test "x$ac_compiler_gnu" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a supported version of gcc" >&5 -$as_echo_n "checking for a supported version of gcc... " >&6; } - gcc_version=`${CC} -dumpversion` - case "${gcc_version}" in - 4.1.0*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (${gcc_version})" >&5 -$as_echo "no (${gcc_version})" >&6; } - as_fn_error $? "gcc 4.1.0 is known to incorrectly compile upx.c. Upgrade your compiler to at least 4.1.1/4.1.2)" "$LINENO" 5 - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (${gcc_version})" >&5 -$as_echo "ok (${gcc_version})" >&6; } - ;; - esac - case "${gcc_version}" in - [56789].* | 4.[3456789].*) - # bb #1581 - temporarely add -fno-strict-aliasing so gcc 4.4.0 - # works correctly - CFLAGS="$CFLAGS -fno-strict-aliasing" - ;; - *) - ;; - esac - fi + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - CFLAGS="$CFLAGS -O0" - VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler" +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac fi -# add distcheck warning flags -distcheck_enable_flags=0 -if test "x$ac_compiler_gnu" = "xyes"; then - gcc_version=`${CC} -dumpversion` - case "${gcc_version}" in - 4.[3456789]*) - distcheck_enable_flags=1 - ;; - [56789].*) - distcheck_enable_flags=1 - ;; - esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR27603" >&5 -$as_echo_n "checking for gcc bug PR27603... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 -$as_echo "cross-compiling, assumed ok" >&6; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* (C) Richard Guenther */ -void exit (int); -void abort (void); -int a; -int main(void) -{ - int j; - for (j = 0; j < 6; j++) - { - if ((unsigned)j - 3 <= 1) - exit (0); - a = 1000 * (6 - j); - } - abort (); -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 -$as_echo "ok, bug not present" >&6; } -else - as_fn_error $? "your compiler has gcc PR27603 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27603" "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR26763-2" >&5 -$as_echo_n "checking for gcc bug PR26763-2... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 -$as_echo "cross-compiling, assumed ok" >&6; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* (C) Richard Guenther */ -extern void abort(void); -static int try (char *a, int d) -{ - return a + d > a; -} -int main(void) -{ - char bla[100]; - if (try (bla + 50, -1)) - abort (); - return 0; -} + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 -$as_echo "ok, bug not present" >&6; } -else - as_fn_error $? "your compiler has gcc PR26763-2 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763" "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for valid code generation of CLI_ISCONTAINED" >&5 -$as_echo_n "checking for valid code generation of CLI_ISCONTAINED... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 -$as_echo "cross-compiling, assumed ok" >&6; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -#include -static struct v{ - char* dst; - unsigned int dsize; - unsigned int dcur; - unsigned int backsize; - signed int unp_offset; -} values[] = { - {(char*)0xf78ab008, 0x2e000, 1, 4, -1594}, - {(char*)0xb7af1008, 0x2e000, 1, 4, -1594} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } -}; -extern void abort(void); -#define CLI_ISCONTAINED(bb, bb_size, sb, sb_size) \ - ((bb_size) > 0 && (sb_size) > 0 && (size_t)(sb_size) <= (size_t)(bb_size) \ - && (sb) >= (bb) && ((sb) + (sb_size)) <= ((bb) + (bb_size)) && ((sb) + (sb_size)) > (bb) && (sb) < ((bb) + (bb_size))) -int crashtest() -{ - unsigned int backsize, dcur; - int dval=0x12000, unp_offset; - int* dsize = &dval; - char* dst = (char*)0x12000; - while(1) { - backsize=4; - dcur=0; - unp_offset=0x800002c7; - if (!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || !CLI_ISCONTAINED(dst, *dsize, dst+dcur, backsize) || unp_offset >=0) - return -1; - abort(); - } - return 0; -} +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -int main(void) -{ - int i; - for(i=0;idst; - unsigned int* dsize = &v->dsize; - unsigned int dcur = v->dcur; - unsigned int backsize = v->backsize-1; - signed int unp_offset = v->unp_offset; +CC="$lt_save_CC" - if(!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || - !CLI_ISCONTAINED(dst, *dsize,dst+dcur,backsize) || unp_offset >= 0) { - continue; - } - abort(); - } - crashtest(); - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 -$as_echo "ok, bug not present" >&6; } -else - as_fn_error $? "your compiler has a bug that causes clamav bug no. 670, use a different compiler, see http://bugs.clamav.net/bugzilla/show_bug.cgi?id=670" "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR28045" >&5 -$as_echo_n "checking for gcc bug PR28045... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 -$as_echo "cross-compiling, assumed ok" >&6; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* (C) Andrew Pinski */ -extern void abort(void); -struct a -{ - unsigned int bits : 1; - signed long val : ((sizeof(long) * 8) - 1); -}; -static int Fnegate (struct a b) -{ - if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL)) - && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1)) - return 0 ; - abort (); -} -int main (void) -{ - struct a b = {1, 1}; - Fnegate (b); - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 -$as_echo "ok, bug not present" >&6; } -else - as_fn_error $? "your compiler has gcc PR28045 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28045" "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR37573" >&5 -$as_echo_n "checking for gcc bug PR37573... " >&6; } -if test "$cross_compiling" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 -$as_echo "cross-compiling, assumed ok" >&6; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct S -{ - unsigned int *a; - unsigned int b; - unsigned int c[624]; -}; -static unsigned char -foo (struct S *s) -{ - unsigned int r; - if (!--s->b) - { - unsigned int *c = s->c; - unsigned int i; - s->a = c; - for (i = 0; i < 227; i++) - c[i] = - ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ - ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397]; - for (; i < 623; i++) - c[i] = - ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ - ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i - 227]; - c[623] = - ((((c[623] ^ c[0]) & 0x7ffffffe) ^ c[623]) >> 1) ^ ((0 - (c[0] & 1)) & - 0x9908b0df) ^ c[i - - - 227]; - } - r = *(s->a++); - r ^= (r >> 11); - r ^= ((r & 0xff3a58ad) << 7); - r ^= ((r & 0xffffdf8c) << 15); - r ^= (r >> 18); - return (unsigned char) (r >> 1); -} -void -bar (unsigned char *p, unsigned int q, unsigned int r) -{ - struct S s; - unsigned int i; - unsigned int *c = s.c; - *c = r; - for (i = 1; i < 624; i++) - c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]); - s.b = 1; - while (q--) - *p++ ^= foo (&s); -}; -static unsigned char p[23] = { - 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49, - 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38 -}; -static unsigned char q[23] = { - 0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43, - 0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c -}; -int -main (void) -{ - unsigned int s; - s = 23; - bar (p, s, s + 0xa25e); - if (memcmp (p, q, s) != 0) - abort (); - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 -$as_echo "ok, bug not present" >&6; } -else - as_fn_error $? "your compiler has gcc PR37573 bug, use a lower optimization level (-O1 or -O2), see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37573" "$LINENO" 5 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + ac_config_commands="$ac_config_commands libtool" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld --version-script" >&5 -$as_echo_n "checking for ld --version-script... " >&6; } -if ${ac_cv_ld_version_script+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.c < conftest.map <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; - then - VERSIONSCRIPTFLAG=--version-script - ac_cv_ld_version_script=yes - else - if { ac_try='${CC-cc} $CFLAGS $pic_flag $LDFLAGS -shared - -o conftest.so conftest.c - -Wl,-M,conftest.map - 1>&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; - then - VERSIONSCRIPTFLAG=-M - ac_cv_ld_version_script=yes; - else - ac_cv_ld_version_script=no - fi - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ld_version_script" >&5 -$as_echo "$ac_cv_ld_version_script" >&6; } - if test "x$ac_cv_ld_version_script" = "xyes"; then - VERSIONSCRIPT_TRUE= - VERSIONSCRIPT_FALSE='#' -else - VERSIONSCRIPT_TRUE='#' - VERSIONSCRIPT_FALSE= -fi +# Only expand once: -# it is not fatal if gperf is missing -GPERF=${GPERF-"${am_missing_run}gperf"} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 +$as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } +if ${libltdl_cv_shlibext+:} false; then : + $as_echo_n "(cached) " >&6 +else +module=yes +eval libltdl_cv_shlibext=$shrext_cmds +module=no +eval libltdl_cv_shrext=$shrext_cmds +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 +$as_echo "$libltdl_cv_shlibext" >&6; } +if test -n "$libltdl_cv_shlibext"; then -for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi +if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then -done - -ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" -if test "x$ac_cv_header_syslog_h" = xyes; then : +cat >>confdefs.h <<_ACEOF +#define LT_SHARED_EXT "$libltdl_cv_shrext" +_ACEOF -$as_echo "#define USE_SYSLOG 1" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 +$as_echo_n "checking which variable specifies run-time module search path... " >&6; } +if ${lt_cv_module_path_var+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_module_path_var="$shlibpath_var" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 +$as_echo "$lt_cv_module_path_var" >&6; } +if test -n "$lt_cv_module_path_var"; then +cat >>confdefs.h <<_ACEOF +#define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" +_ACEOF +fi -ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 +$as_echo_n "checking for the default library search path... " >&6; } +if ${lt_cv_sys_dlsearch_path+:} false; then : + $as_echo_n "(cached) " >&6 else + lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 +$as_echo "$lt_cv_sys_dlsearch_path" >&6; } +if test -n "$lt_cv_sys_dlsearch_path"; then + sys_dlsearch_path= + for dir in $lt_cv_sys_dlsearch_path; do + if test -z "$sys_dlsearch_path"; then + sys_dlsearch_path="$dir" + else + sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" + fi + done cat >>confdefs.h <<_ACEOF -#define off_t long int +#define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : + +LT_DLLOADERS= + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +LIBADD_DLOPEN= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if ${ac_cv_search_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else - for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "confdefs.h" -#include - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); int main () { -switch (0) case 0: case (sizeof (short) == $ac_size):; +return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sizeof_short=$ac_size +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_dlopen+:} false; then : + break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_short != x ; then break; fi done +if ${ac_cv_search_dlopen+:} false; then : +else + ac_cv_search_dlopen=no fi - -if test x$ac_cv_sizeof_short = x ; then - as_fn_error $? "cannot determine a size for short" "$LINENO" 5 +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +$as_echo "#define HAVE_LIBDL 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 + if test "$ac_cv_search_dlopen" != "none required" ; then + LIBADD_DLOPEN="-ldl" + fi + libltdl_cv_lib_dl_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else - for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "confdefs.h" -#include - +#if HAVE_DLFCN_H +# include +#endif int main () { -switch (0) case 0: case (sizeof (int) == $ac_size):; +dlopen(0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sizeof_int=$ac_size -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_int != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_int = x ; then - as_fn_error $? "cannot determine a size for int" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF +if ac_fn_c_try_link "$LINENO"; then : +$as_echo "#define HAVE_LIBDL 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : + libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else - for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "confdefs.h" -#include - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); int main () { -switch (0) case 0: case (sizeof (long) == $ac_size):; +return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sizeof_long=$ac_size +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_long != x ; then break; fi -done +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + +$as_echo "#define HAVE_LIBDL 1" >>confdefs.h + LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi -if test x$ac_cv_sizeof_long = x ; then - as_fn_error $? "cannot determine a size for long" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes +then + lt_save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + for ac_func in dlerror +do : + ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" +if test "x$ac_cv_func_dlerror" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLERROR 1 _ACEOF +fi +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : + LIBS="$lt_save_LIBS" +fi + + +LIBADD_SHL_LOAD= +ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + +$as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h + + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else - for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include "confdefs.h" -#include - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); int main () { -switch (0) case 0: case (sizeof (long long) == $ac_size):; +return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sizeof_long_long=$ac_size +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_long_long != x ; then break; fi -done +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + +$as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" + LIBADD_SHL_LOAD="-ldld" fi -if test x$ac_cv_sizeof_long_long = x ; then - as_fn_error $? "cannot determine a size for long long" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include "confdefs.h" -#include - - -int -main () -{ -switch (0) case 0: case (sizeof (void *) == $ac_size):; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sizeof_void_p=$ac_size -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_void_p != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_void_p = x ; then - as_fn_error $? "cannot determine a size for void *" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF - - - -for ac_func in sysctlbyname -do : - ac_fn_c_check_func "$LINENO" "sysctlbyname" "ac_cv_func_sysctlbyname" -if test "x$ac_cv_func_sysctlbyname" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYSCTLBYNAME 1 -_ACEOF - -fi -done - -for ac_func in getifaddrs -do : - ac_fn_c_check_func "$LINENO" "getifaddrs" "ac_cv_func_getifaddrs" -if test "x$ac_cv_func_getifaddrs" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETIFADDRS 1 -_ACEOF - -fi -done - -ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = xyes; then : - -$as_echo "#define HAVE_FCNTL_H 1" >>confdefs.h -fi - - -ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - -$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h - -fi -ac_fn_c_check_header_mongrel "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "$ac_includes_default" -if test "x$ac_cv_header_net_if_dl_h" = xyes; then : +case $host_os in +darwin[1567].*) +# We only want this for pre-Mac OS X 10.4. + ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" +if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : -$as_echo "#define HAVE_NET_IF_DL_H 1" >>confdefs.h +$as_echo "#define HAVE_DYLD 1" >>confdefs.h + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi - - -# Check whether --enable-experimental was given. -if test "${enable_experimental+set}" = set; then : - enableval=$enable_experimental; enable_experimental=$enableval + ;; +beos*) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + ;; +cygwin* | mingw* | os2* | pw32*) + ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include +" +if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : + ac_have_decl=1 else - enable_experimental="no" -fi - - -if test "$enable_experimental" = "yes"; then - -$as_echo "#define CL_EXPERIMENTAL 1" >>confdefs.h - - VERSION_SUFFIX="$VERSION_SUFFIX-exp" + ac_have_decl=0 fi -build_configure_args=`echo "$ac_configure_args" | sed -e 's/\"//g'` -BUILD_CONFIGURE_FLAGS=$build_configure_args - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uname(2) is POSIX" >&5 -$as_echo_n "checking whether uname(2) is POSIX... " >&6; } - if ${ax_cv_uname_syscall+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - ax_cv_uname_syscall=no - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int main() { struct utsname unm; -return uname( &unm ); } +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ax_cv_uname_syscall=yes -else - ax_cv_uname_syscall=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - # end of TRY_RUN -fi - # end of CACHE_VAL - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_uname_syscall" >&5 -$as_echo "$ax_cv_uname_syscall" >&6; } - if test x$ax_cv_uname_syscall = xyes - then - -$as_echo "#define HAVE_UNAME_SYSCALL 1" >>confdefs.h - fi + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" + ;; +esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bind in -lsocket" >&5 -$as_echo_n "checking for bind in -lsocket... " >&6; } -if ${ac_cv_lib_socket_bind+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $LIBS" +LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14543,604 +12364,453 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char bind (); +char dld_link (); int main () { -return bind (); +return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_socket_bind=yes + ac_cv_lib_dld_dld_link=yes else - ac_cv_lib_socket_bind=no + ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_bind" >&5 -$as_echo "$ac_cv_lib_socket_bind" >&6; } -if test "x$ac_cv_lib_socket_bind" = xyes; then : - LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket" -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 -$as_echo_n "checking for library containing gethostent... " >&6; } -if ${ac_cv_search_gethostent+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define HAVE_DLD 1" >>confdefs.h -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostent (); -int -main () -{ -return gethostent (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_gethostent=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gethostent+:} false; then : - break + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi -done -if ${ac_cv_search_gethostent+:} false; then : -else - ac_cv_search_gethostent=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5 -$as_echo "$ac_cv_search_gethostent" >&6; } -ac_res=$ac_cv_search_gethostent -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - (LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl") -fi -for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + +LT_DLPREOPEN= +if test -n "$LT_DLLOADERS" +then + for lt_loader in $LT_DLLOADERS; do + LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " + done + +$as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if ${ac_cv_sys_largefile_source+:} false; then : - $as_echo_n "(cached) " >&6 -else - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include /* for off_t */ - #include -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_sys_largefile_source=no; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 -#include /* for off_t */ - #include -int -main () -{ -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_sys_largefile_source=1; break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_cv_sys_largefile_source=unknown - break -done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 -$as_echo "$ac_cv_sys_largefile_source" >&6; } -case $ac_cv_sys_largefile_source in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source -_ACEOF -;; -esac -rm -rf conftest* - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -if test $ac_cv_sys_largefile_source != unknown; then -$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" -fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 -$as_echo_n "checking for working mmap... " >&6; } -if ${ac_cv_c_mmap_private+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 +$as_echo_n "checking for _ prefix in compiled symbols... " >&6; } +if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else - - if test "$cross_compiling" = yes; then : - ac_cv_c_mmap_private=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#include -int main(void) -{ - char *data, *data2, *data3; - unsigned i, datasize = 1024; - int fd; - - /* First, make a file with some known garbage in it. */ - data = (char*) malloc(datasize); - if(!data) - return 1; - for(i=0;i&5 -$as_echo "$ac_cv_c_mmap_private" >&6; } -if test $ac_cv_c_mmap_private = yes; then - -$as_echo "#define HAVE_MMAP 1" >>confdefs.h + lt_cv_sys_symbol_underscore=no + cat > conftest.$ac_ext <<_LT_EOF +void nm_test_func(){} +int main(){nm_test_func;return 0;} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + ac_nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$ac_nlist"; then + # See whether the symbols have a leading underscore. + if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then + lt_cv_sys_symbol_underscore=yes + else + if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then + : + else + echo "configure: cannot find nm_test_func in $ac_nlist" >&5 + fi + fi + else + echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "configure: failed program was:" >&5 + cat conftest.c >&5 + fi + rm -rf conftest* fi -rm -f conftest.mmap +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 +$as_echo "$lt_cv_sys_symbol_underscore" >&6; } + sys_symbol_underscore=$lt_cv_sys_symbol_underscore -ac_cv_c_can_get_pagesize="no" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysconf(_SC_PAGESIZE)" >&5 -$as_echo_n "checking for sysconf(_SC_PAGESIZE)... " >&6; } -if ${ac_cv_c_sysconf_sc_pagesize+:} false; then : +if test x"$lt_cv_sys_symbol_underscore" = xyes; then + if test x"$libltdl_cv_func_dlopen" = xyes || + test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 +$as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } +if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#if HAVE_UNISTD_H -#include -#endif -int -main () -{ -int x = sysconf(_SC_PAGESIZE); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_c_sysconf_sc_pagesize=yes + libltdl_cv_need_uscore=unknown + save_LIBS="$LIBS" + LIBS="$LIBS $LIBADD_DLOPEN" + if test "$cross_compiling" = yes; then : + libltdl_cv_need_uscore=cross else - ac_cv_c_sysconf_sc_pagesize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_sysconf_sc_pagesize" >&5 -$as_echo "$ac_cv_c_sysconf_sc_pagesize" >&6; } -if test "$ac_cv_c_sysconf_sc_pagesize" = "yes"; then + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" -$as_echo "#define HAVE_SYSCONF_SC_PAGESIZE 1" >>confdefs.h +#if HAVE_DLFCN_H +#include +#endif - ac_cv_c_can_get_pagesize="yes" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize()" >&5 -$as_echo_n "checking for getpagesize()... " >&6; } -if ${ac_cv_c_getpagesize+:} false; then : - $as_echo_n "(cached) " >&6 -else +#include - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -#if HAVE_UNISTD_H -#include +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif #endif -int -main () + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () { -int x = getpagesize(); - ; - return 0; + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_c_getpagesize=yes -else - ac_cv_c_getpagesize=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; + x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; + x$lt_dlunknown|x*) ;; + esac + else : + # compilation failed + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_getpagesize" >&5 -$as_echo "$ac_cv_c_getpagesize" >&6; } -if test "$ac_cv_c_getpagesize" = "yes"; then +rm -fr conftest* -$as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h + LIBS="$save_LIBS" - ac_cv_c_can_get_pagesize="yes" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 +$as_echo "$libltdl_cv_need_uscore" >&6; } + fi +fi + +if test x"$libltdl_cv_need_uscore" = xyes; then +$as_echo "#define NEED_USCORE 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5 -$as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; } -if ${ac_cv_c_mmap_anonymous+:} false; then : +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 +$as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } +if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else + # PORTME does your system automatically load deplibs for dlopen? + # or its logical equivalent (e.g. shl_load for HP-UX < 11) + # For now, we just catch OSes we know something about -- in the + # future, we'll try test this programmatically. + lt_cv_sys_dlopen_deplibs=unknown + case $host_os in + aix3*|aix4.1.*|aix4.2.*) + # Unknown whether this is true for these versions of AIX, but + # we want this `case' here to explicitly catch those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + aix[4-9]*) + lt_cv_sys_dlopen_deplibs=yes + ;; + amigaos*) + case $host_cpu in + powerpc) + lt_cv_sys_dlopen_deplibs=no + ;; + esac + ;; + darwin*) + # Assuming the user has installed a libdl from somewhere, this is true + # If you are looking for one http://www.opendarwin.org/projects/dlcompat + lt_cv_sys_dlopen_deplibs=yes + ;; + freebsd* | dragonfly*) + lt_cv_sys_dlopen_deplibs=yes + ;; + gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) + # GNU and its variants, using gnu ld.so (Glibc) + lt_cv_sys_dlopen_deplibs=yes + ;; + hpux10*|hpux11*) + lt_cv_sys_dlopen_deplibs=yes + ;; + interix*) + lt_cv_sys_dlopen_deplibs=yes + ;; + irix[12345]*|irix6.[01]*) + # Catch all versions of IRIX before 6.2, and indicate that we don't + # know how it worked for any of those versions. + lt_cv_sys_dlopen_deplibs=unknown + ;; + irix*) + # The case above catches anything before 6.2, and it's known that + # at 6.2 and later dlopen does load deplibs. + lt_cv_sys_dlopen_deplibs=yes + ;; + netbsd* | netbsdelf*-gnu) + lt_cv_sys_dlopen_deplibs=yes + ;; + openbsd*) + lt_cv_sys_dlopen_deplibs=yes + ;; + osf[1234]*) + # dlopen did load deplibs (at least at 4.x), but until the 5.x series, + # it did *not* use an RPATH in a shared library to find objects the + # library depends on, so we explicitly say `no'. + lt_cv_sys_dlopen_deplibs=no + ;; + osf5.0|osf5.0a|osf5.1) + # dlopen *does* load deplibs and with the right loader patch applied + # it even uses RPATH in a shared library to search for shared objects + # that the library depends on, but there's no easy way to know if that + # patch is installed. Since this is the case, all we can really + # say is unknown -- it depends on the patch being installed. If + # it is, this changes to `yes'. Without it, it would be `no'. + lt_cv_sys_dlopen_deplibs=unknown + ;; + osf*) + # the two cases above should catch all versions of osf <= 5.1. Read + # the comments above for what we know about them. + # At > 5.1, deplibs are loaded *and* any RPATH in a shared library + # is used to find them so we can finally say `yes'. + lt_cv_sys_dlopen_deplibs=yes + ;; + qnx*) + lt_cv_sys_dlopen_deplibs=yes + ;; + solaris*) + lt_cv_sys_dlopen_deplibs=yes + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + libltdl_cv_sys_dlopen_deplibs=yes + ;; + esac - ac_cv_c_mmap_anonymous='no' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_c_mmap_anonymous='MAP_ANONYMOUS' -else +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 +$as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } +if test "$lt_cv_sys_dlopen_deplibs" != yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h -/* OPENBSD WORKAROUND - DND*/ -#include -/* OPENBSD WORKAROUND - END*/ -#include +fi -int -main () -{ -mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); - ; - return 0; -} +: + +for ac_header in argz.h +do : + ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default +" +if test "x$ac_cv_header_argz_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ARGZ_H 1 _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_c_mmap_anonymous='MAP_ANON' fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +done -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_mmap_anonymous" >&5 -$as_echo "$ac_cv_c_mmap_anonymous" >&6; } - if test "$ac_cv_c_mmap_anonymous" != "no"; then +ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) +# include +#endif +" +if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF -#define ANONYMOUS_MAP $ac_cv_c_mmap_anonymous +#define HAVE_ERROR_T 1 _ACEOF - fi -# Check whether --enable-mempool was given. -if test "${enable_mempool+set}" = set; then : - enableval=$enable_mempool; enable_mempool=$enableval else - enable_mempool="yes" -fi -have_mempool="no" -if test "$enable_mempool" = "yes"; then - if test "$ac_cv_c_mmap_private" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (mmap not available or not usable)" >&5 -$as_echo "$as_me: ****** mempool support disabled (mmap not available or not usable)" >&6;} - else - if test "$ac_cv_c_can_get_pagesize" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (pagesize cannot be determined)" >&5 -$as_echo "$as_me: ****** mempool support disabled (pagesize cannot be determined)" >&6;} - else - if test "$ac_cv_c_mmap_anonymous" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (anonymous mmap not available)" >&5 -$as_echo "$as_me: ****** mempool support disabled (anonymous mmap not available)" >&6;} - else +$as_echo "#define error_t int" >>confdefs.h -$as_echo "#define USE_MPOOL 1" >>confdefs.h - have_mempool="yes" - fi - fi - fi -fi +$as_echo "#define __error_t_defined 1" >>confdefs.h -enable_check_ut=auto -enable_ut_install=no -# Check whether --enable-check was given. -if test "${enable_check+set}" = set; then : - enableval=$enable_check; enable_check_ut=$enableval -else - enable_check_ut="auto" fi -if test "$enable_check_ut" != "no" ; then +ARGZ_H= +for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ + argz_next argz_stringify +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF - if test "X$prefix" = "XNONE"; then - acl_final_prefix="$ac_default_prefix" - else - acl_final_prefix="$prefix" - fi - if test "X$exec_prefix" = "XNONE"; then - acl_final_exec_prefix='${prefix}' - else - acl_final_exec_prefix="$exec_prefix" - fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" - prefix="$acl_save_prefix" +else + ARGZ_H=argz.h; + _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no fi +done -# Prepare PATH_SEPARATOR. -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 -$as_echo_n "checking for ld used by GCC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${acl_cv_path_LD+:} false; then : + +if test -z "$ARGZ_H"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 +$as_echo_n "checking if argz actually works... " >&6; } +if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in - *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; - *) - test "$with_gnu_ld" != yes && break ;; - esac - fi - done - IFS="$ac_save_ifs" -else - acl_cv_path_LD="$LD" # Let the user override the test with a path. -fi + case $host_os in #( + *cygwin*) + lt_cv_sys_argz_works=no + if test "$cross_compiling" != no; then + lt_cv_sys_argz_works="guessing no" + else + lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' + save_IFS=$IFS + IFS=-. + set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` + IFS=$save_IFS + lt_os_major=${2-0} + lt_os_minor=${3-0} + lt_os_micro=${4-0} + if test "$lt_os_major" -gt 1 \ + || { test "$lt_os_major" -eq 1 \ + && { test "$lt_os_minor" -gt 5 \ + || { test "$lt_os_minor" -eq 5 \ + && test "$lt_os_micro" -gt 24; }; }; }; then + lt_cv_sys_argz_works=yes + fi + fi + ;; #( + *) lt_cv_sys_argz_works=yes ;; + esac fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 +$as_echo "$lt_cv_sys_argz_works" >&6; } + if test "$lt_cv_sys_argz_works" = yes; then : + +$as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h -LD="$acl_cv_path_LD" -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ARGZ_H=argz.h + + + _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" + fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${acl_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU ld's only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$acl_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$acl_cv_prog_gnu_ld - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 -$as_echo_n "checking for shared library run path origin... " >&6; } -if ${acl_cv_rpath+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 +$as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } +if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else + if test -n "$lt_cv_sys_global_symbol_pipe"; then + libltdl_cv_preloaded_symbols=yes + else + libltdl_cv_preloaded_symbols=no + fi - CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ - ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh - . ./conftest.sh - rm -f ./conftest.sh - acl_cv_rpath=done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 -$as_echo "$acl_cv_rpath" >&6; } - wl="$acl_cv_wl" - acl_libext="$acl_cv_libext" - acl_shlibext="$acl_cv_shlibext" - acl_libname_spec="$acl_cv_libname_spec" - acl_library_names_spec="$acl_cv_library_names_spec" - acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" - acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" - acl_hardcode_direct="$acl_cv_hardcode_direct" - acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; : -else - enable_rpath=yes fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 +$as_echo "$libltdl_cv_preloaded_symbols" >&6; } +if test x"$libltdl_cv_preloaded_symbols" = xyes; then +$as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h +fi +# Set options @@ -15148,570 +12818,300 @@ fi - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - use_additional=yes +# Check whether --with-included_ltdl was given. +if test "${with_included_ltdl+set}" = set; then : + withval=$with_included_ltdl; +fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +if test "x$with_included_ltdl" != xyes; then + # We are not being forced to use the included libltdl sources, so + # decide whether there is a useful installed version we can use. + ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +" +if test "x$ac_cv_header_ltdl_h" = xyes; then : + ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default + #include +" +if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 +$as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; } +if ${ac_cv_lib_ltdl_lt_dladvise_preload+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lltdl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lt_dladvise_preload (); +int +main () +{ +return lt_dladvise_preload (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ltdl_lt_dladvise_preload=yes +else + ac_cv_lib_ltdl_lt_dladvise_preload=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5 +$as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } +if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes; then : + with_included_ltdl=no +else + with_included_ltdl=yes +fi -# Check whether --with-libcheck-prefix was given. -if test "${with_libcheck_prefix+set}" = set; then : - withval=$with_libcheck_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - additional_compat_libdir= - if test "X$withval" = "X"; then +else + with_included_ltdl=yes +fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +else + with_included_ltdl=yes +fi - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +fi + - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "X$acl_libdirstem" != "Xlib"; then - additional_compat_libdir="-L$withval/lib" - fi - fi - fi + +# Check whether --with-ltdl_include was given. +if test "${with_ltdl_include+set}" = set; then : + withval=$with_ltdl_include; fi - LIBCHECK= - LTLIBCHECK= - INCCHECK= - LIBCHECK_PREFIX= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='check ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - compat_libdir= - if test "X$acl_libdirstem" != "Xlib"; then - compat_libdir=-L'${exec_prefix}'/lib - fi - for x in $LDFLAGS $LTLIBCHECK $compat_libdir $additional_compat_libdir; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +if test -n "$with_ltdl_include"; then + if test -f "$with_ltdl_include/ltdl.h"; then : + else + as_fn_error $? "invalid ltdl include directory: \`$with_ltdl_include'" "$LINENO" 5 + fi +else + with_ltdl_include=no +fi - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBCHECK; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +# Check whether --with-ltdl_lib was given. +if test "${with_ltdl_lib+set}" = set; then : + withval=$with_ltdl_lib; +fi - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" - else - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_a" - else - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBCHECK_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/lib/"'*$,,'` - LIBCHECK_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCCHECK; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +if test -n "$with_ltdl_lib"; then + if test -f "$with_ltdl_lib/libltdl.la"; then : + else + as_fn_error $? "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5 + fi +else + with_ltdl_lib=no +fi - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCCHECK="${INCCHECK}${INCCHECK:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBCHECK; do +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in + ,yes,no,no,) + case $enable_ltdl_convenience in + no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; +esac +LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" +LTDLDEPS=$LIBLTDL +LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBCHECK; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$dep" - LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }$dep" - ;; - esac - done - fi - else - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-l$name" - LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-R$found_dir" - done - fi - CPPFLAGS="$CPPFLAGS $INCCHECK" - ac_fn_c_check_header_mongrel "$LINENO" "check.h" "ac_cv_header_check_h" "$ac_includes_default" -if test "x$ac_cv_header_check_h" = xyes; then : - have_header=yes -else - have_header=no -fi +# For backwards non-gettext consistent compatibility... +INCLTDL="$LTDLINCL" - ac_cv_findlib_CHECK_libs= - ac_cv_findlib_CHECK_ltlibs= - ac_cv_findlib_CHECK_inc= - if test "$have_header" = "yes"; then : + ;; + ,no,no,no,) + # If the included ltdl is not to be used, then use the + # preinstalled libltdl we found. - LIBS="$LIBS $LIBCHECK" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking with check" >&5 -$as_echo_n "checking linking with check... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -srunner_create(0) - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +$as_echo "#define HAVE_LTDL 1" >>confdefs.h - ac_cv_findlib_CHECK_libs="$LIBCHECK" - ac_cv_findlib_CHECK_ltlibs="$LTLIBCHECK" - ac_cv_findlib_CHECK_inc="$INCCHECK" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + LIBLTDL=-lltdl + LTDLDEPS= + LTDLINCL= + ;; + ,no*,no,*) + as_fn_error $? "\`--with-ltdl-include' and \`--with-ltdl-lib' options must be used together" "$LINENO" 5 + ;; + *) with_included_ltdl=no + LIBLTDL="-L$with_ltdl_lib -lltdl" + LTDLDEPS= + LTDLINCL="-I$with_ltdl_include" + ;; +esac +INCLTDL="$LTDLINCL" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +# Report our decision... +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 +$as_echo_n "checking where to find libltdl headers... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 +$as_echo "$LTDLINCL" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 +$as_echo_n "checking where to find libltdl library... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 +$as_echo "$LIBLTDL" >&6; } + + +# Check whether --enable-ltdl-install was given. +if test "${enable_ltdl_install+set}" = set; then : + enableval=$enable_ltdl_install; fi - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - if test "X$ac_cv_findlib_CHECK_libs" = "X"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: unable to compile/link with check" >&5 -$as_echo "$as_me: unable to compile/link with check" >&6;} - HAVE_LIBCHECK=no +case ,${enable_ltdl_install},${enable_ltdl_convenience} in + *yes*) ;; + *) enable_ltdl_convenience=yes ;; +esac + + if test x"${enable_ltdl_install-no}" != xno; then + INSTALL_LTDL_TRUE= + INSTALL_LTDL_FALSE='#' +else + INSTALL_LTDL_TRUE='#' + INSTALL_LTDL_FALSE= +fi + if test x"${enable_ltdl_convenience-no}" != xno; then + CONVENIENCE_LTDL_TRUE= + CONVENIENCE_LTDL_FALSE='#' else + CONVENIENCE_LTDL_TRUE='#' + CONVENIENCE_LTDL_FALSE= +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with check by using $ac_cv_findlib_CHECK_inc $ac_cv_findlib_CHECK_libs" >&5 -$as_echo "$as_me: Compiling and linking with check by using $ac_cv_findlib_CHECK_inc $ac_cv_findlib_CHECK_libs" >&6;} -$as_echo "#define HAVE_LIBCHECK 1" >>confdefs.h - HAVE_LIBCHECK=yes - LIBCHECK="$ac_cv_findlib_CHECK_libs" - LTLIBCHECK="$ac_cv_findlib_CHECK_ltlibs" - INCCHECK="$ac_cv_findlib_CHECK_inc" - CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK" -fi +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS +# the user used. This is so that ltdl.h can pick up the parent projects +# config.h file, The first file in AC_CONFIG_HEADERS must contain the +# definitions required by ltdl.c. +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). + + + +for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi +done + + +for ac_func in closedir opendir readdir +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF - if test "X$HAVE_LIBCHECK" = "Xyes"; then - HAVE_LIBCHECK_TRUE= - HAVE_LIBCHECK_FALSE='#' else - HAVE_LIBCHECK_TRUE='#' - HAVE_LIBCHECK_FALSE= -fi -if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then - as_fn_error $? " + _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" -ERROR! Check was configured, but not found. Get it from http://check.sf.net/ -" "$LINENO" 5 fi +done + +for ac_func in strlcat strlcpy +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -# Check whether --enable-coverage was given. -if test "${enable_coverage+set}" = set; then : - enableval=$enable_coverage; enable_cov=$enableval else - enable_cov="no" + + + _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" + fi +done -if test "x$enable_coverage" = "xyes"; then - if test "x$CHECK_LIBS" = "x"; then - as_fn_error $? "Coverage testing required, but unit tests not enabled!" "$LINENO" 5 - fi - if test "x$ac_compiler_gnu" != "xyes"; then - as_fn_error $? "coverage testing only works if gcc is used" "$LINENO" 5 - fi - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - LDFLAGS="$LDFLAGS -lgcov" - for ac_prog in gcov -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +cat >>confdefs.h <<_ACEOF +#define LT_LIBEXT "$libext" +_ACEOF + + +name= +eval "lt_libprefix=\"$libname_spec\"" + +cat >>confdefs.h <<_ACEOF +#define LT_LIBPREFIX "$lt_libprefix" +_ACEOF + + +name=ltdl +eval "LTDLOPEN=\"$libname_spec\"" + + + + + + + + +# Only expand once: + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GCOV+:} false; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$GCOV"; then - ac_cv_prog_GCOV="$GCOV" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -15720,7 +13120,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GCOV="$ac_prog" + ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -15730,31 +13130,28 @@ IFS=$as_save_IFS fi fi -GCOV=$ac_cv_prog_GCOV -if test -n "$GCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 -$as_echo "$GCOV" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$GCOV" && break -done -test -n "$GCOV" || GCOV="false" - - for ac_prog in lcov -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LCOV+:} false; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$LCOV"; then - ac_cv_prog_LCOV="$LCOV" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -15763,7 +13160,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LCOV="$ac_prog" + ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -15773,31 +13170,41 @@ IFS=$as_save_IFS fi fi -LCOV=$ac_cv_prog_LCOV -if test -n "$LCOV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 -$as_echo "$LCOV" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi - test -n "$LCOV" && break -done -test -n "$LCOV" || LCOV="false" - - for ac_prog in genhtml -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GENHTML+:} false; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$GENHTML"; then - ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -15806,7 +13213,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_GENHTML="$ac_prog" + ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -15816,2523 +13223,2176 @@ IFS=$as_save_IFS fi fi -GENHTML=$ac_cv_prog_GENHTML -if test -n "$GENHTML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 -$as_echo "$GENHTML" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$GENHTML" && break + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -test -n "$GENHTML" || GENHTML="false" + done +IFS=$as_save_IFS +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi fi - - if test "x$enable_coverage" = "xyes"; then - ENABLE_COVERAGE_TRUE= - ENABLE_COVERAGE_FALSE='#' +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - ENABLE_COVERAGE_TRUE='#' - ENABLE_COVERAGE_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -have_pthreads=no -ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - have_pthreads=yes fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 else - USE_MAINTAINER_MODE=no -fi + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - MAINT=$MAINTAINER_MODE_TRUE - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib installation" >&5 -$as_echo_n "checking for zlib installation... " >&6; } - -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; -if test "$withval"; then - ZLIB_HOME="$withval" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using $ZLIB_HOME" >&5 -$as_echo "using $ZLIB_HOME" >&6; } + test -n "$CC" && break + done fi - +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -ZLIB_HOME=/usr/local -if test ! -f "$ZLIB_HOME/include/zlib.h" -then - ZLIB_HOME=/usr fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZLIB_HOME" >&5 -$as_echo "$ZLIB_HOME" >&6; } - fi - - -CLAMDSCAN_LIBS="$FRESHCLAM_LIBS" - -# Check whether --enable-zlib-vcheck was given. -if test "${enable_zlib_vcheck+set}" = set; then : - enableval=$enable_zlib_vcheck; zlib_check=$enableval +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - zlib_check="yes" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test ! -f "$ZLIB_HOME/include/zlib.h" -then - as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5 -else + test -n "$ac_ct_CC" && break +done - vuln=`grep "ZLIB_VERSION \"1.2.0" $ZLIB_HOME/include/zlib.h` - if test -z "$vuln"; then - vuln=`grep "ZLIB_VERSION \"1.2.1" $ZLIB_HOME/include/zlib.h` - fi + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi - if test -n "$vuln"; then - if test "$zlib_check" = "yes"; then - as_fn_error $? "The installed zlib version may contain a security bug. Please upgrade to 1.2.2 or later: http://www.zlib.net. You can omit this check with --disable-zlib-vcheck but DO NOT REPORT any stability issues then!" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** This ClamAV installation may be linked against" >&5 -$as_echo "$as_me: WARNING: ****** This ClamAV installation may be linked against" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** a broken zlib version. Please DO NOT report any" >&5 -$as_echo "$as_me: WARNING: ****** a broken zlib version. Please DO NOT report any" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** stability problems to the ClamAV developers!" >&5 -$as_echo "$as_me: WARNING: ****** stability problems to the ClamAV developers!" >&2;} - fi - fi +fi - save_LIBS="$LIBS" - if test "$ZLIB_HOME" != "/usr"; then - CPPFLAGS="$CPPFLAGS -I$ZLIB_HOME/include" - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$ZLIB_HOME/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 -$as_echo_n "checking for inflateEnd in -lz... " >&6; } -if ${ac_cv_lib_z_inflateEnd+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflateEnd (); +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + int main () { -return inflateEnd (); +#ifndef __GNUC__ + choke me +#endif + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflateEnd=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes else - ac_cv_lib_z_inflateEnd=no + ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 -$as_echo "$ac_cv_lib_z_inflateEnd" >&6; } -if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : - LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$ZLIB_HOME/lib -lz"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$ZLIB_HOME/lib -lz" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes else - as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5 + GCC= fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 -$as_echo_n "checking for gzopen in -lz... " >&6; } -if ${ac_cv_lib_z_gzopen+:} false; then : +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gzopen (); int main () { -return gzopen (); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_gzopen=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes else - ac_cv_lib_z_gzopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5 -$as_echo "$ac_cv_lib_z_gzopen" >&6; } -if test "x$ac_cv_lib_z_gzopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBZ 1 -_ACEOF + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - LIBS="-lz $LIBS" +int +main () +{ -else - as_fn_error $? "Your zlib is missing gzopen()" "$LINENO" 5 -fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : - LDFLAGS="$save_LDFLAGS" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 -$as_echo_n "checking for inflateEnd in -lz... " >&6; } -if ${ac_cv_lib_z_inflateEnd+:} false; then : - $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflateEnd (); int main () { -return inflateEnd (); + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflateEnd=yes -else - ac_cv_lib_z_inflateEnd=no +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 -$as_echo "$ac_cv_lib_z_inflateEnd" >&6; } -if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : - LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz";FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lz" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi else - as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5 + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 -$as_echo_n "checking for gzopen in -lz... " >&6; } -if ${ac_cv_lib_z_gzopen+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" + ac_cv_prog_cc_c89=no +ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gzopen (); +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -return gzopen (); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_gzopen=yes -else - ac_cv_lib_z_gzopen=no +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5 -$as_echo "$ac_cv_lib_z_gzopen" >&6; } -if test "x$ac_cv_lib_z_gzopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBZ 1 -_ACEOF +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : - LIBS="-lz $LIBS" +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - as_fn_error $? "Your zlib is missing gzopen()" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } fi - fi - LIBS="$save_LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make fi - -# Check whether --enable-bzip2 was given. -if test "${enable_bzip2+set}" = set; then : - enableval=$enable_bzip2; want_bzip2=$enableval +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= else - want_bzip2="yes" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" fi -bzip_check="ok" -if test "$want_bzip2" = "yes" -then +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 +$as_echo_n "checking for _mwvalidcheckl in -lmw... " >&6; } +if ${ac_cv_lib_mw__mwvalidcheckl+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _mwvalidcheckl (); +int +main () +{ +return _mwvalidcheckl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_mw__mwvalidcheckl=yes +else + ac_cv_lib_mw__mwvalidcheckl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 +$as_echo "$ac_cv_lib_mw__mwvalidcheckl" >&6; } +if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes; then : + LIBM="-lmw" +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM="$LIBM -lm" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libbz2" >&5 -$as_echo_n "checking how to link with libbz2... " >&6; } -if ${ac_cv_libbz2_libs+:} false; then : + ;; +*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +$as_echo_n "checking for cos in -lm... " >&6; } +if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cos (); +int +main () +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_cos=yes +else + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +$as_echo "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes; then : + LIBM="-lm" +fi + ;; +esac - use_additional=yes - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +$ac_includes_default - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +fi +done -# Check whether --with-libbz2-prefix was given. -if test "${with_libbz2_prefix+set}" = set; then : - withval=$with_libbz2_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - additional_compat_libdir= - if test "X$withval" = "X"; then +ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default" +if test "x$ac_cv_header_syslog_h" = xyes; then : - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +$as_echo "#define USE_SYSLOG 1" >>confdefs.h - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +fi - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "X$acl_libdirstem" != "Xlib"; then - additional_compat_libdir="-L$withval/lib" - fi - fi - fi -fi +have_pthreads=no +ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : + have_pthreads=yes +fi - LIBBZ2= - LTLIBBZ2= - INCBZ2= - LIBBZ2_PREFIX= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='bz2 ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - compat_libdir= - if test "X$acl_libdirstem" != "Xlib"; then - compat_libdir=-L'${exec_prefix}'/lib - fi - for x in $LDFLAGS $LTLIBBZ2 $compat_libdir $additional_compat_libdir; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +if test "$have_pthreads" = "yes"; then - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBBZ2; do +$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +fi - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" - else - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_a" - else - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBBZ2_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/lib/"'*$,,'` - LIBBZ2_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCBZ2; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +ac_config_files="$ac_config_files libltdl/Makefile" - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCBZ2="${INCBZ2}${INCBZ2:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBBZ2; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBBZ2; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$dep" - LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }$dep" - ;; - esac - done - fi - else - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-l$name" - LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$flag" - done - fi - fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-R$found_dir" - done - fi - - ac_cv_libbz2_libs="$LIBBZ2" - ac_cv_libbz2_ltlibs="$LTLIBBZ2" - ac_cv_libbz2_cppflags="$INCBZ2" - ac_cv_libbz2_prefix="$LIBBZ2_PREFIX" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbz2_libs" >&5 -$as_echo "$ac_cv_libbz2_libs" >&6; } - LIBBZ2="$ac_cv_libbz2_libs" - LTLIBBZ2="$ac_cv_libbz2_ltlibs" - INCBZ2="$ac_cv_libbz2_cppflags" - LIBBZ2_PREFIX="$ac_cv_libbz2_prefix" - - for element in $INCBZ2; do - haveit= - for x in $CPPFLAGS; do - - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - if test "X$x" = "X$element"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" - fi - done +$as_echo "#define SCANBUFF 131072" >>confdefs.h +$as_echo "#define FILEBUFF 8192" >>confdefs.h - HAVE_LIBBZ2=yes + # Only modify libdir if user has not overriden it + default_libdir='${exec_prefix}/lib' + if test "$libdir" = "$default_libdir"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multiarch libdir" >&5 +$as_echo_n "checking for multiarch libdir... " >&6; } + # Based on http://lists.gnu.org/archive/html/autoconf/2008-09/msg00072.html + if test "$GCC" = yes; then + ac_multilibdir=`$CC -print-multi-os-directory $CFLAGS $CPPFLAGS $LDFLAGS` || ac_multilibdir=. + else + ac_multilibdir=. + fi + case "$ac_multilibdir" in + # I don't know if the first two cases can happen, but it would be a + # bad idea to override $exec_prefix + /* | ../../* | .) acl_libdirstem=lib ;; + ../*) acl_libdirstem=`echo $ac_multilibdir | sed 's/^...//' ` ;; + *) acl_libdirstem=lib/$ac_multilibdir ;; + esac + libdir='${exec_prefix}/'$acl_libdirstem + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libdir" >&5 +$as_echo "$libdir" >&6; } + else + acl_libdirstem=lib + if test -d "$libdir"; then + case "$libdir" in + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; + *) searchdir=`cd "$libdir" && pwd` + case "$searchdir" in + */lib64 ) acl_libdirstem=lib64 ;; + esac + esac + fi + fi - save_LDFLAGS="$LDFLAGS" - # Only add -L if prefix is not empty - test -z "$LIBBZ2_PREFIX" || LDFLAGS="$LDFLAGS -L$LIBBZ2_PREFIX/$acl_libdirstem"; - have_bzprefix="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5 -$as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; } -if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbz2 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char BZ2_bzDecompressInit (); +typedef int * int_ptr; + int foo (int_ptr $ac_kw ip) { + return ip[0]; + } int main () { -return BZ2_bzDecompressInit (); +int s[1]; + int * $ac_kw t = s; + t[0] = 0; + return foo(t) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_bz2_BZ2_bzDecompressInit=yes -else - ac_cv_lib_bz2_BZ2_bzDecompressInit=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5 -$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; } -if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then : - have_bzprefix="yes" +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done - if test "x$have_bzprefix" = "xno"; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } -$as_echo "#define NOBZ2PREFIX 1" >>confdefs.h + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac - fi - LDFLAGS="$save_LDFLAGS" - if test "$HAVE_LIBBZ2" = "yes"; then - ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" -if test "x$ac_cv_header_bzlib_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CVE-2008-1372" >&5 -$as_echo_n "checking for CVE-2008-1372... " >&6; } -if ${ac_cv_c_cve_2008_1372+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else - -save_LIBS="$LIBS" -LIBS="$LIBCLAMAV_LIBS $LIBBZ2" -if test "$cross_compiling" = yes; then : - ac_cv_c_cve_2008_1372=ok -else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#include - -#ifdef NOBZ2PREFIX -#define BZ2_bzReadOpen bzReadOpen -#define BZ2_bzReadClose bzReadClose -#define BZ2_bzRead bzRead -#define BZ2_bzDecompressInit bzDecompressInit -#define BZ2_bzDecompress bzDecompress -#define BZ2_bzDecompressEnd bzDecompressEnd -#endif - -const unsigned char poc[] = { - 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x20, 0x0c, - 0xa6, 0x9c, 0x00, 0x00, 0xc2, 0xfb, 0x90, 0xca, 0x10, 0x04, 0x00, 0x40, - 0x03, 0x77, 0x80, 0x06, 0x00, 0x7a, 0x2f, 0xde, 0x40, 0x04, 0x00, 0x40, - 0x08, 0x30, 0x00, 0xb9, 0xb0, 0x4a, 0x89, 0xa3, 0x43, 0x4d, 0x00, 0x00, - 0x01, 0xb5, 0x04, 0xa4, 0x6a, 0x19, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, - 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, - 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, - 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, - 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, - 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x2a, 0xad, 0x2a, 0x91, 0x32, - 0x9a, 0x32, 0x0d, 0x06, 0x8d, 0x00, 0x03, 0xf7, 0x13, 0xd2, 0xf5, 0x54, - 0x5b, 0x20, 0x4b, 0x34, 0x40, 0x8a, 0x6b, 0xaa, 0x64, 0xd8, 0x30, 0x9d, - 0x8a, 0x9a, 0x52, 0x44, 0x13, 0x46, 0x37, 0xd9, 0x0a, 0x3c, 0xa6, 0xee, - 0xe9, 0xee, 0xec, 0x6d, 0x4a, 0x65, 0xc2, 0x32, 0xcb, 0x43, 0x82, 0x48, - 0xa1, 0x26, 0xc3, 0x43, 0x11, 0x47, 0x0a, 0x5e, 0xc1, 0x30, 0x55, 0x84, - 0xb1, 0x25, 0x7a, 0x2b, 0x86, 0x0e, 0xc8, 0x1a, 0x45, 0x10, 0xf1, 0xa9, - 0x19, 0x00, 0x30, 0x3c, 0x2a, 0xeb, 0x16, 0x6a, 0x75, 0x86, 0x60, 0xd0, - 0xc7, 0xd0, 0x94, 0x34, 0xf1, 0x6b, 0x49, 0x9f, 0x30, 0x4e, 0x0f, 0x70, - 0xbe, 0x12, 0x28, 0xe9, 0x7d, 0x10, 0x80, 0x35, 0x53, 0xaf, 0x72, 0xe1, - 0x83, 0x90, 0xb8, 0xf8, 0x4b, 0x1a, 0xa4, 0x29, 0x1b, 0x90, 0xe1, 0x4a, - 0x0f, 0xc5, 0xdc, 0x91, 0x4e, 0x14, 0x24, 0x08, 0x03, 0x29, 0xa7, 0x00 -}; -const unsigned int poc_len = 252; +int +main () +{ -int main (int argc, char **argv) { - bz_stream bz; - char buf[1024]; +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; - memset(&bz, 0, sizeof(bz)); - bz.next_in = (char *)&poc; - bz.avail_in = poc_len; - bz.next_out = buf; - bz.avail_out = sizeof(buf); - if(BZ2_bzDecompressInit(&bz, 0, 0)!=BZ_OK) - return 1; + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif - while((BZ2_bzDecompress(&bz))==BZ_OK) { - bz.next_out = buf; - bz.avail_out = sizeof(buf); - } - BZ2_bzDecompressEnd(&bz); - return 0; + ; + return 0; } - _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_cve_2008_1372=ok -else - -if test $? -gt 127; then - ac_cv_c_cve_2008_1372=bugged +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes else - ac_cv_c_cve_2008_1372=linkfailed -fi - + ac_cv_c_const=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then -LIBS="$save_LIBS" +$as_echo "#define const /**/" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_cve_2008_1372" >&5 -$as_echo "$ac_cv_c_cve_2008_1372" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_c_cve_2008_1372="no" -fi + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done - if test "$ac_cv_c_cve_2008_1372" = "bugged"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 libraries are affected by the CVE-2008-1372 bug" >&5 -$as_echo "$as_me: WARNING: ****** bzip2 libraries are affected by the CVE-2008-1372 bug" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** We strongly suggest you to update to bzip2 1.0.5." >&5 -$as_echo "$as_me: WARNING: ****** We strongly suggest you to update to bzip2 1.0.5." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 -$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} - bzip_check="bugged (CVE-2008-1372)" - fi - if test "$ac_cv_c_cve_2008_1372" = "linkfailed"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Unable to link bzip2 testcase" >&5 -$as_echo "$as_me: WARNING: ****** Unable to link bzip2 testcase" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** You may be affected by CVE-2008-1372 bug, but I need to be able to link a testcase to verify" >&5 -$as_echo "$as_me: WARNING: ****** You may be affected by CVE-2008-1372 bug, but I need to be able to link a testcase to verify" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&5 -$as_echo "$as_me: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 -$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} - bzip_check="link failed (CVE-2008-1372)" - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } - case "$ac_cv_c_cve_2008_1372" in - ok|bugged|linkfailed) - ;; - *) - HAVE_LIBBZ2=no - ;; - esac - fi +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac - if test "$HAVE_LIBBZ2" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CVE-2010-0405" >&5 -$as_echo_n "checking for CVE-2010-0405... " >&6; } -if ${ac_cv_c_cve_2010_0405+:} false; then : + { $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 : $as_echo_n "(cached) " >&6 else - -save_LIBS="$LIBS" -LIBS="$LIBCLAMAV_LIBS $LIBBZ2" -if test "$cross_compiling" = yes; then : - ac_cv_c_cve_2010_0405=ok -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; -#include -#include -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef NOBZ2PREFIX -#define BZ2_bzReadOpen bzReadOpen -#define BZ2_bzReadClose bzReadClose -#define BZ2_bzRead bzRead -#define BZ2_bzDecompressInit bzDecompressInit -#define BZ2_bzDecompress bzDecompress -#define BZ2_bzDecompressEnd bzDecompressEnd -#endif - -const unsigned char poc[] = { -0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -0xff, 0xff, 0xfe, 0x20, 0x2c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, -0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff -}; -const unsigned int poc_len = 280; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -int main (int argc, char **argv) { - bz_stream bz; - char buf[1024]; + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include - memset(&bz, 0, sizeof(bz)); - bz.next_in = (char *)&poc; - bz.avail_in = poc_len; - bz.next_out = buf; - bz.avail_out = sizeof(buf); +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif - alarm(10); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include - if(BZ2_bzDecompressInit(&bz, 0, 0)!=BZ_OK) - return 1; +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif - while((BZ2_bzDecompress(&bz))==BZ_OK) { - bz.next_out = buf; - bz.avail_out = sizeof(buf); - } - BZ2_bzDecompressEnd(&bz); - return 0; + ; + return 0; } - _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_cve_2010_0405=ok -else - -if test $? -gt 127; then - ac_cv_c_cve_2010_0405=bugged +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - ac_cv_c_cve_2010_0405=linkfailed -fi - -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_c_bigendian=no fi - -LIBS="$save_LIBS" - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_cve_2010_0405" >&5 -$as_echo "$ac_cv_c_cve_2010_0405" >&6; } - - if test "$ac_cv_c_cve_2010_0405" = "bugged"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 libraries are affected by the CVE-2010-0405 bug" >&5 -$as_echo "$as_me: WARNING: ****** bzip2 libraries are affected by the CVE-2010-0405 bug" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** We strongly suggest you to update bzip2" >&5 -$as_echo "$as_me: WARNING: ****** We strongly suggest you to update bzip2" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 -$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} - bzip_check="bugged (CVE-2010-0405)" - fi - if test "$ac_cv_c_cve_2010_0405" = "linkfailed"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Unable to link bzip2 testcase" >&5 -$as_echo "$as_me: WARNING: ****** Unable to link bzip2 testcase" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** You may be affected by CVE-2010-0405 bug, but I need to be able to link a testcase to verify" >&5 -$as_echo "$as_me: WARNING: ****** You may be affected by CVE-2010-0405 bug, but I need to be able to link a testcase to verify" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&5 -$as_echo "$as_me: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 -$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} - bzip_check="link failed (CVE-2010-0405)" - fi - - case "$ac_cv_c_cve_2010_0405" in - ok|bugged|linkfailed) - LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS $LTLIBBZ2" - -$as_echo "#define HAVE_BZLIB_H 1" >>confdefs.h - - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 support disabled" >&5 -$as_echo "$as_me: WARNING: ****** bzip2 support disabled" >&2;} - ;; - esac - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 support disabled" >&5 -$as_echo "$as_me: WARNING: ****** bzip2 support disabled" >&2;} +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -fi - -have_curl="no" -curl_msg="Please use the web interface for submitting FPs/FNs." -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl installation" >&5 -$as_echo_n "checking for libcurl installation... " >&6; } - - -# Check whether --with-libcurl was given. -if test "${with_libcurl+set}" = set; then : - withval=$with_libcurl; -if test "$withval"; then - LIBCURL_HOME="$withval" -fi - -else - -LIBCURL_HOME=/usr/local -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - LIBCURL_HOME=/usr -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCURL_HOME" >&5 -$as_echo "$LIBCURL_HOME" >&6; } - -fi - + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&5 -$as_echo "$as_me: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&2;} -else - if test -f "$LIBCURL_HOME/bin/curl-config"; then - CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs) - CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags) - else - CURL_LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" - CURL_CPPFLAGS="-I$LIBCURL_HOME/include" - fi +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif - save_LDFLAGS="$LDFLAGS" - LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5 -$as_echo_n "checking for curl_easy_init in -lcurl... " >&6; } -if ${ac_cv_lib_curl_curl_easy_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char curl_easy_init (); int main () { -return curl_easy_init (); +#ifndef _BIG_ENDIAN + not big endian + #endif + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_curl_curl_easy_init=yes +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - ac_cv_lib_curl_curl_easy_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + ac_cv_c_bigendian=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_easy_init" >&5 -$as_echo "$ac_cv_lib_curl_curl_easy_init" >&6; } -if test "x$ac_cv_lib_curl_curl_easy_init" = xyes; then : - curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs." >&5 -$as_echo "$as_me: WARNING: Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs." >&2;} +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi fi - - if test "x$HAVE_LIBBZ2" = "xyes"; then - HAVE_LIBBZ2_TRUE= - HAVE_LIBBZ2_FALSE='#' +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - HAVE_LIBBZ2_TRUE='#' - HAVE_LIBBZ2_FALSE= -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; -# Check whether --enable-unrar was given. -if test "${enable_unrar+set}" = set; then : - enableval=$enable_unrar; want_unrar=$enableval + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no else - want_unrar="yes" + ac_cv_c_bigendian=yes fi - - if test "$want_unrar" = "yes"; then - ENABLE_UNRAR_TRUE= - ENABLE_UNRAR_FALSE='#' -else - ENABLE_UNRAR_TRUE='#' - ENABLE_UNRAR_FALSE= +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - -want_xml="auto" -# Check whether --enable-xml was given. -if test "${enable_xml+set}" = set; then : - enableval=$enable_xml; want_xml=$enableval -else - want_xml="auto" + fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h -XML_HOME="" -if test "X$want_xml" != "Xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2 installation" >&5 -$as_echo_n "checking for libxml2 installation... " >&6; } + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac -# Check whether --with-xml was given. -if test "${with_xml+set}" = set; then : - withval=$with_xml; - if test "$withval" - then - XML_HOME="$withval" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using $XML_HOME" >&5 -$as_echo "using $XML_HOME" >&6; } - else - as_fn_error $? "cannot assign blank value to --with-xml" "$LINENO" 5 - fi +# Check whether --enable-gcc-vcheck was given. +if test "${enable_gcc_vcheck+set}" = set; then : + enableval=$enable_gcc_vcheck; gcc_check=$enableval else - - XML_HOME=/usr/local - if test ! -x "$XML_HOME/bin/xml2-config" - then - XML_HOME=/usr - if test ! -x "$XML_HOME/bin/xml2-config" - then - XML_HOME="" - fi - fi - if test "x$XML_HOME" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML_HOME" >&5 -$as_echo "$XML_HOME" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - fi - + gcc_check="yes" fi -fi -found_xml="no" -XMLCONF_VERSION="" -XML_CPPFLAGS="" -XML_LIBS="" -if test "x$XML_HOME" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking xml2-config version" >&5 -$as_echo_n "checking xml2-config version... " >&6; } - XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`" - if test "x%XMLCONF_VERSION" != "x"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLCONF_VERSION" >&5 -$as_echo "$XMLCONF_VERSION" >&6; } - found_xml="yes" - XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`" - XML_LIBS="`$XML_HOME/bin/xml2-config --libs`" - else - as_fn_error $? "xml2-config failed" "$LINENO" 5 - fi +msg_gcc_check="use --disable-gcc-vcheck to disable this check. Before reporting any bugs check with a supported version of gcc" +VERSION_SUFFIX= +if test "$gcc_check" = "yes"; then + if test "x$ac_compiler_gnu" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a supported version of gcc" >&5 +$as_echo_n "checking for a supported version of gcc... " >&6; } + gcc_version=`${CC} -dumpversion` + case "${gcc_version}" in + 4.1.0*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (${gcc_version})" >&5 +$as_echo "no (${gcc_version})" >&6; } + as_fn_error $? "gcc 4.1.0 is known to incorrectly compile upx.c. Upgrade your compiler to at least 4.1.1/4.1.2)" "$LINENO" 5 + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (${gcc_version})" >&5 +$as_echo "ok (${gcc_version})" >&6; } + ;; + esac + case "${gcc_version}" in + [56789].* | 4.[3456789].*) + # bb #1581 - temporarely add -fno-strict-aliasing so gcc 4.4.0 + # works correctly + CFLAGS="$CFLAGS -fno-strict-aliasing" + ;; + *) + ;; + esac + fi +else + CFLAGS="$CFLAGS -O0" + VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler" fi -working_xml="no" -if test "X$found_xml" != "Xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlreader.h in $XML_HOME" >&5 -$as_echo_n "checking for xmlreader.h in $XML_HOME... " >&6; } +# add distcheck warning flags +distcheck_enable_flags=0 +if test "x$ac_compiler_gnu" = "xyes"; then + gcc_version=`${CC} -dumpversion` + case "${gcc_version}" in + 4.[3456789]*) + distcheck_enable_flags=1 + ;; + [56789].*) + distcheck_enable_flags=1 + ;; + esac +fi - if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } - save_LIBS="$LIBS" - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $XML_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlTextReaderRead in -lxml2" >&5 -$as_echo_n "checking for xmlTextReaderRead in -lxml2... " >&6; } -if ${ac_cv_lib_xml2_xmlTextReaderRead+:} false; then : - $as_echo_n "(cached) " >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR27603" >&5 +$as_echo_n "checking for gcc bug PR27603... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 +$as_echo "cross-compiling, assumed ok" >&6; } else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lxml2 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char xmlTextReaderRead (); -int -main () +/* (C) Richard Guenther */ +void exit (int); +void abort (void); +int a; +int main(void) { -return xmlTextReaderRead (); - ; - return 0; + int j; + for (j = 0; j < 6; j++) + { + if ((unsigned)j - 3 <= 1) + exit (0); + a = 1000 * (6 - j); + } + abort (); } + _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_xml2_xmlTextReaderRead=yes -else - ac_cv_lib_xml2_xmlTextReaderRead=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlTextReaderRead" >&5 -$as_echo "$ac_cv_lib_xml2_xmlTextReaderRead" >&6; } -if test "x$ac_cv_lib_xml2_xmlTextReaderRead" = xyes; then : - working_xml="yes" +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 +$as_echo "ok, bug not present" >&6; } else - working_xml="no" + as_fn_error $? "your compiler has gcc PR27603 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27603" "$LINENO" 5 fi - - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -if test "$working_xml" = "yes"; then -$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR26763-2" >&5 +$as_echo_n "checking for gcc bug PR26763-2... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 +$as_echo "cross-compiling, assumed ok" >&6; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* (C) Richard Guenther */ +extern void abort(void); +static int try (char *a, int d) +{ + return a + d > a; +} - { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with libxml2 from $XML_HOME" >&5 -$as_echo "$as_me: Compiling and linking with libxml2 from $XML_HOME" >&6;} -else - if test "$want_xml" = "yes"; then - as_fn_error $? "****** Please install libxml2 packages!" "$LINENO" 5 - else - if test "$want_xml" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: ****** libxml2 support unavailable" >&5 -$as_echo "$as_me: ****** libxml2 support unavailable" >&6;} - fi - fi - XML_CPPFLAGS="" - XML_LIBS="" +int main(void) +{ + char bla[100]; + if (try (bla + 50, -1)) + abort (); -fi + return 0; +} -# Check whether --enable-getaddrinfo was given. -if test "${enable_getaddrinfo+set}" = set; then : - enableval=$enable_getaddrinfo; want_getaddrinfo=$enableval +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 +$as_echo "ok, bug not present" >&6; } else - want_getaddrinfo="yes" + as_fn_error $? "your compiler has gcc PR26763-2 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763" "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -if test "$want_getaddrinfo" = "yes" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 -$as_echo_n "checking for getaddrinfo... " >&6; } - if ${have_cv_gai+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - have_cv_gai=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for valid code generation of CLI_ISCONTAINED" >&5 +$as_echo_n "checking for valid code generation of CLI_ISCONTAINED... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 +$as_echo "cross-compiling, assumed ok" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include - #include - int main(int argc, char **argv) - { - struct addrinfo *res; - int sd; +#include +static struct v{ + char* dst; + unsigned int dsize; + unsigned int dcur; + unsigned int backsize; + signed int unp_offset; +} values[] = { + {(char*)0xf78ab008, 0x2e000, 1, 4, -1594}, + {(char*)0xb7af1008, 0x2e000, 1, 4, -1594} - if(getaddrinfo("127.0.0.1", NULL, NULL, &res) < 0) - return 1; - freeaddrinfo(res); +}; +extern void abort(void); - return 0; - } +#define CLI_ISCONTAINED(bb, bb_size, sb, sb_size) \ + ((bb_size) > 0 && (sb_size) > 0 && (size_t)(sb_size) <= (size_t)(bb_size) \ + && (sb) >= (bb) && ((sb) + (sb_size)) <= ((bb) + (bb_size)) && ((sb) + (sb_size)) > (bb) && (sb) < ((bb) + (bb_size))) + +int crashtest() +{ + unsigned int backsize, dcur; + int dval=0x12000, unp_offset; + int* dsize = &dval; + char* dst = (char*)0x12000; + while(1) { + backsize=4; + dcur=0; + unp_offset=0x800002c7; + + if (!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || !CLI_ISCONTAINED(dst, *dsize, dst+dcur, backsize) || unp_offset >=0) + return -1; + abort(); + } + return 0; +} + +int main(void) +{ + int i; + for(i=0;idst; + unsigned int* dsize = &v->dsize; + unsigned int dcur = v->dcur; + unsigned int backsize = v->backsize-1; + signed int unp_offset = v->unp_offset; + + if(!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || + !CLI_ISCONTAINED(dst, *dsize,dst+dcur,backsize) || unp_offset >= 0) { + continue; + } + abort(); + } + crashtest(); + return 0; +} _ACEOF if ac_fn_c_try_run "$LINENO"; then : - have_cv_gai=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 +$as_echo "ok, bug not present" >&6; } else - have_cv_gai=no + as_fn_error $? "your compiler has a bug that causes clamav bug no. 670, use a different compiler, see http://bugs.clamav.net/bugzilla/show_bug.cgi?id=670" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_gai" >&5 -$as_echo "$have_cv_gai" >&6; } - if test "$have_cv_gai" = yes; then - -$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR28045" >&5 +$as_echo_n "checking for gcc bug PR28045... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 +$as_echo "cross-compiling, assumed ok" >&6; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - fi -fi +/* (C) Andrew Pinski */ +extern void abort(void); +struct a +{ + unsigned int bits : 1; + signed long val : ((sizeof(long) * 8) - 1); +}; +static int Fnegate (struct a b) +{ + if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL)) + && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1)) + return 0 ; + abort (); +} +int main (void) +{ + struct a b = {1, 1}; + Fnegate (b); + return 0; +} -# Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then : - enableval=$enable_ipv6; want_ipv6=$enableval +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 +$as_echo "ok, bug not present" >&6; } else - want_ipv6="yes" + as_fn_error $? "your compiler has gcc PR28045 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28045" "$LINENO" 5 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -if test "$want_ipv6" = "yes" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 support" >&5 -$as_echo_n "checking for IPv6 support... " >&6; } - if ${have_cv_ipv6+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : - have_cv_ipv6=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc bug PR37573" >&5 +$as_echo_n "checking for gcc bug PR37573... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, assumed ok" >&5 +$as_echo "cross-compiling, assumed ok" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include - #include - #include - #include - int main(int argc, char **argv) - { - struct addrinfo *res, hints; - int sd; +#include +#include +struct S +{ + unsigned int *a; + unsigned int b; + unsigned int c[624]; +}; +static unsigned char +foo (struct S *s) +{ + unsigned int r; + if (!--s->b) + { + unsigned int *c = s->c; + unsigned int i; + s->a = c; + for (i = 0; i < 227; i++) + c[i] = + ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ + ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397]; + for (; i < 623; i++) + c[i] = + ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ + ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i - 227]; + c[623] = + ((((c[623] ^ c[0]) & 0x7ffffffe) ^ c[623]) >> 1) ^ ((0 - (c[0] & 1)) & + 0x9908b0df) ^ c[i + - + 227]; + } + r = *(s->a++); + r ^= (r >> 11); + r ^= ((r & 0xff3a58ad) << 7); + r ^= ((r & 0xffffdf8c) << 15); + r ^= (r >> 18); + return (unsigned char) (r >> 1); +} + +void +bar (unsigned char *p, unsigned int q, unsigned int r) +{ + struct S s; + unsigned int i; + unsigned int *c = s.c; + *c = r; + for (i = 1; i < 624; i++) + c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]); + s.b = 1; + while (q--) + *p++ ^= foo (&s); +}; + +static unsigned char p[23] = { + 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49, + 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38 +}; + +static unsigned char q[23] = { + 0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43, + 0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c +}; + +int +main (void) +{ + unsigned int s; + s = 23; + bar (p, s, s + 0xa25e); + if (memcmp (p, q, s) != 0) + abort (); + return 0; +} - if((sd = socket(AF_INET6, SOCK_STREAM, 0)) < 0) - return 1; - close(sd); - /* also check if getaddrinfo() handles AF_UNSPEC -- bb#1196 */ - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - if(getaddrinfo("127.0.0.1", NULL, &hints, &res) < 0) - return 1; - freeaddrinfo(res); - return 0; - } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - have_cv_ipv6=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok, bug not present" >&5 +$as_echo "ok, bug not present" >&6; } else - have_cv_ipv6=no + as_fn_error $? "your compiler has gcc PR37573 bug, use a lower optimization level (-O1 or -O2), see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37573" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_ipv6" >&5 -$as_echo "$have_cv_ipv6" >&6; } - if test "$have_cv_ipv6" = yes; then - -$as_echo "#define SUPPORT_IPv6 1" >>confdefs.h - - fi -fi - - +# It's not fatal if gperf is missing -# Check whether --enable-dns was given. -if test "${enable_dns+set}" = set; then : - enableval=$enable_dns; want_dns=$enableval -else - want_dns=yes +GPERF=${GPERF-"${am_missing_run}gperf"} -fi -if test $want_dns = yes; then - ac_cv_have_lresolv=no - ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" " -#include -#include -#include -" -if test "x$ac_cv_header_resolv_h" = xyes; then : +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_expand in std libs" >&5 -$as_echo_n "checking for dn_expand in std libs... " >&6; } -if ${ac_cv_have_lresolv_std+:} false; then : - $as_echo_n "(cached) " >&6 else - ac_cv_have_lresolv_std='no' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -#include -int main() { return (long)dn_expand; } - +cat >>confdefs.h <<_ACEOF +#define off_t long int _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - ac_cv_have_lresolv_std='yes' - ac_cv_have_lresolv='' fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lresolv_std" >&5 -$as_echo "$ac_cv_have_lresolv_std" >&6; } - if test "x$ac_cv_have_lresolv" = "xno"; then - bklibs=$LIBS - LIBS=-lresolv - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_expand in -lresolv" >&5 -$as_echo_n "checking for dn_expand in -lresolv... " >&6; } -if ${ac_cv_have_lresolv_lresolv+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } +if ${ac_cv_sizeof_short+:} false; then : $as_echo_n "(cached) " >&6 else - - ac_cv_have_lresolv_lresolv='yes' - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - +#include "confdefs.h" #include -#include -#include -#include -int main() { return (long)dn_expand; } - -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - ac_cv_have_lresolv_lresolv='yes' - ac_cv_have_lresolv=' -lresolv' -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +int +main () +{ +switch (0) case 0: case (sizeof (short) == $ac_size):; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sizeof_short=$ac_size fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lresolv_lresolv" >&5 -$as_echo "$ac_cv_have_lresolv_lresolv" >&6; } - LIBS=$bklibs; - fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_short != x ; then break; fi +done -else - ac_cv_have_lresolv=no fi - - if test "x$ac_cv_have_lresolv" != "xno"; then - FRESHCLAM_LIBS="$FRESHCLAM_LIBS$ac_cv_have_lresolv" - -$as_echo "#define HAVE_RESOLV_H 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** DNS support disabled" >&5 -$as_echo "$as_me: WARNING: ****** DNS support disabled" >&2;} - fi +if test x$ac_cv_sizeof_short = x ; then + as_fn_error $? "cannot determine a size for short" "$LINENO" 5 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF -# Check whether --enable-fanotify was given. -if test "${enable_fanotify+set}" = set; then : - enableval=$enable_fanotify; want_fanotify=$enableval -else - want_fanotify="yes" -fi - - -if test "$cross_compiling" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } -if ${ac_cv_func_setpgrp_void+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 -else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include "confdefs.h" +#include + + int main () { -/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - return setpgrp (1,1) != -1; +switch (0) case 0: case (sizeof (int) == $ac_size):; ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_setpgrp_void=no -else - ac_cv_func_setpgrp_void=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sizeof_int=$ac_size fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_int != x ; then break; fi +done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } -if test $ac_cv_func_setpgrp_void = yes; then - -$as_echo "#define SETPGRP_VOID 1" >>confdefs.h -fi +if test x$ac_cv_sizeof_int = x ; then + as_fn_error $? "cannot determine a size for int" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } -if ${ac_cv_func_setpgrp_void+:} false; then : +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include "confdefs.h" +#include -#include int main () { - - if (setpgrp(1,1) == -1) - exit (0); - else - exit (1); - +switch (0) case 0: case (sizeof (long) == $ac_size):; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_func_setpgrp_void=no -else - ac_cv_func_setpgrp_void=yes + ac_cv_sizeof_long=$ac_size fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } -if test $ac_cv_func_setpgrp_void = yes; then - $as_echo "#define SETPGRP_VOID 1" >>confdefs.h + if test x$ac_cv_sizeof_long != x ; then break; fi +done fi -fi -# Check whether --enable-milter was given. -if test "${enable_milter+set}" = set; then : - enableval=$enable_milter; have_milter=$enableval -else - have_milter="no" +if test x$ac_cv_sizeof_long = x ; then + as_fn_error $? "cannot determine a size for long" "$LINENO" 5 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF -# Check whether --with-iconv was given. -if test "${with_iconv+set}" = set; then : - withval=$with_iconv; - case "$withval" in - yes|no) wiconv="$withval";; - *) as_fn_error $? "--with-iconv does not take an argument" "$LINENO" 5;; - esac -else - wiconv=auto -fi - -if test "X$wiconv" != "Xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 -$as_echo_n "checking for libiconv_open in -liconv... " >&6; } -if ${ac_cv_lib_iconv_libiconv_open+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-liconv $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include "confdefs.h" +#include + -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libiconv_open (); int main () { -return libiconv_open (); +switch (0) case 0: case (sizeof (long long) == $ac_size):; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_iconv_libiconv_open=yes -else - ac_cv_lib_iconv_libiconv_open=no +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sizeof_long_long=$ac_size fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_long_long != x ; then break; fi +done + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 -$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } -if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then : - LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -liconv" + +if test x$ac_cv_sizeof_long_long = x ; then + as_fn_error $? "cannot determine a size for long long" "$LINENO" 5 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 -$as_echo_n "checking for iconv... " >&6; } - save_LIBS="$LIBS" - LIBS="$LIBCLAMAV_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include "confdefs.h" +#include - #include int main () { - - char** xin,**xout; - unsigned long il,ol; - int rc; - iconv_t iconv_struct = iconv_open("UTF-16BE","UTF-8"); - rc = iconv(iconv_struct,xin,&il,xout,&ol); - iconv_close(iconv_struct); - +switch (0) case 0: case (sizeof (void *) == $ac_size):; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_ICONV 1" >>confdefs.h - - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sizeof_void_p=$ac_size fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test x$ac_cv_sizeof_void_p != x ; then break; fi +done + fi -# Check whether --enable-pthreads was given. -if test "${enable_pthreads+set}" = set; then : - enableval=$enable_pthreads; have_pthreads=$enableval +if test x$ac_cv_sizeof_void_p = x ; then + as_fn_error $? "cannot determine a size for void *" "$LINENO" 5 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF -# Check whether --enable-cr was given. -if test "${enable_cr+set}" = set; then : - enableval=$enable_cr; use_cr=$enableval -fi -# Check whether --enable-id-check was given. -if test "${enable_id_check+set}" = set; then : - enableval=$enable_id_check; use_id=$enableval +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld --version-script" >&5 +$as_echo_n "checking for ld --version-script... " >&6; } +if ${ac_cv_ld_version_script+:} false; then : + $as_echo_n "(cached) " >&6 else - use_id="no" + cat > conftest.c < conftest.map <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; + then + VERSIONSCRIPTFLAG=--version-script + ac_cv_ld_version_script=yes + else + if { ac_try='${CC-cc} $CFLAGS $pic_flag $LDFLAGS -shared + -o conftest.so conftest.c + -Wl,-M,conftest.map + 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; + then + VERSIONSCRIPTFLAG=-M + ac_cv_ld_version_script=yes; + else + ac_cv_ld_version_script=no + fi + fi + rm -f conftest* fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_ld_version_script" >&5 +$as_echo "$ac_cv_ld_version_script" >&6; } - -# Check whether --enable-yp-check was given. -if test "${enable_yp_check+set}" = set; then : - enableval=$enable_yp_check; use_yp=$enableval + if test "x$ac_cv_ld_version_script" = "xyes"; then + VERSIONSCRIPT_TRUE= + VERSIONSCRIPT_FALSE='#' else - use_yp="no" + VERSIONSCRIPT_TRUE='#' + VERSIONSCRIPT_FALSE= fi -# Check whether --with-user was given. -if test "${with_user+set}" = set; then : - withval=$with_user; clamav_user="$withval" +# Check whether --enable-experimental was given. +if test "${enable_experimental+set}" = set; then : + enableval=$enable_experimental; enable_experimental=$enableval else - clamav_user="clamav" + enable_experimental="no" fi +if test "$enable_experimental" = "yes"; then -# Check whether --with-group was given. -if test "${with_group+set}" = set; then : - withval=$with_group; clamav_group="$withval" -else - clamav_group="clamav" -fi - - +$as_echo "#define CL_EXPERIMENTAL 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define CLAMAVUSER "$clamav_user" -_ACEOF + VERSION_SUFFIX="$VERSION_SUFFIX-exp" +fi +build_configure_args=`echo "$ac_configure_args" | sed -e 's/\"//g'` +BUILD_CONFIGURE_FLAGS=$build_configure_args -cat >>confdefs.h <<_ACEOF -#define CLAMAVGROUP "$clamav_group" -_ACEOF -# Check whether --enable-clamav was given. -if test "${enable_clamav+set}" = set; then : - enableval=$enable_clamav; test_clamav=$enableval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uname(2) is POSIX" >&5 +$as_echo_n "checking whether uname(2) is POSIX... " >&6; } + if ${ax_cv_uname_syscall+:} false; then : + $as_echo_n "(cached) " >&6 else - test_clamav=yes -fi + if test "$cross_compiling" = yes; then : + ax_cv_uname_syscall=no -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; enable_debug=$enableval else - enable_debug="no" -fi - - -if test "$enable_debug" = "yes"; then - VERSION_SUFFIX="$VERSION_SUFFIX-debug" - -$as_echo "#define CL_DEBUG 1" >>confdefs.h - + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int main() { struct utsname unm; +return uname( &unm ); } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ax_cv_uname_syscall=yes else - -$as_echo "#define NDEBUG 1" >>confdefs.h - + ax_cv_uname_syscall=no fi - - -# Check whether --with-version was given. -if test "${with_version+set}" = set; then : - withval=$with_version; VERSION="$withval" +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - - -# Check whether --enable-no-cache was given. -if test "${enable_no_cache+set}" = set; then : - enableval=$enable_no_cache; enable_nocache=$enableval -else - enable_nocache="no" + # end of TRY_RUN fi + # end of CACHE_VAL + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_uname_syscall" >&5 +$as_echo "$ax_cv_uname_syscall" >&6; } + if test x$ax_cv_uname_syscall = xyes + then -if test "$enable_nocache" = "yes"; then - -$as_echo "#define FRESHCLAM_NO_CACHE 1" >>confdefs.h +$as_echo "#define HAVE_UNAME_SYSCALL 1" >>confdefs.h -fi + fi -# Check whether --enable-dns-fix was given. -if test "${enable_dns_fix+set}" = set; then : - enableval=$enable_dns_fix; enable_dnsfix=$enableval +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bind in -lsocket" >&5 +$as_echo_n "checking for bind in -lsocket... " >&6; } +if ${ac_cv_lib_socket_bind+:} false; then : + $as_echo_n "(cached) " >&6 else - enable_dnsfix="no" -fi - - -if test "$enable_dnsfix" = "yes"; then - -$as_echo "#define FRESHCLAM_DNS_FIX 1" >>confdefs.h - -fi + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -# Check whether --enable-bigstack was given. -if test "${enable_bigstack+set}" = set; then : - enableval=$enable_bigstack; enable_bigstack=$enableval +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char bind (); +int +main () +{ +return bind (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_socket_bind=yes else - enable_bigstack="no" -fi - - -if test "$enable_bigstack" = "yes"; then - -$as_echo "#define C_BIGSTACK 1" >>confdefs.h - + ac_cv_lib_socket_bind=no fi - - -# Check whether --with-dbdir was given. -if test "${with_dbdir+set}" = set; then : - withval=$with_dbdir; db_dir="$withval" -else - db_dir="_default_" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - - -if test "$db_dir" = "_default_" -then - if test "$prefix" = "NONE" - then - db_dir="$ac_default_prefix/share/clamav" - else - db_dir="$prefix/share/clamav" - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_bind" >&5 +$as_echo "$ac_cv_lib_socket_bind" >&6; } +if test "x$ac_cv_lib_socket_bind" = xyes; then : + LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket" fi - -cat >>confdefs.h <<_ACEOF -#define DATADIR "$db_dir" -_ACEOF - -DBDIR="$db_dir" - - -cfg_dir=`echo $sysconfdir | grep prefix` - -if test -n "$cfg_dir"; then - if test "$prefix" = "NONE" - then - cfg_dir="$ac_default_prefix/etc" - else - cfg_dir="$prefix/etc" - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 +$as_echo_n "checking for library containing gethostent... " >&6; } +if ${ac_cv_search_gethostent+:} false; then : + $as_echo_n "(cached) " >&6 else - cfg_dir="$sysconfdir" -fi - -CFGDIR=$cfg_dir - - -cat >>confdefs.h <<_ACEOF -#define CONFDIR "$cfg_dir" -_ACEOF - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether in_port_t is defined" >&5 -$as_echo_n "checking whether in_port_t is defined... " >&6; } + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostent (); int main () { -in_port_t pt; pt = 0; return pt; +return gethostent (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +for ac_lib in '' nsl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_gethostent=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_gethostent+:} false; then : + break +fi +done +if ${ac_cv_search_gethostent+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +else + ac_cv_search_gethostent=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5 +$as_echo "$ac_cv_search_gethostent" >&6; } +ac_res=$ac_cv_search_gethostent +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + (LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl") +fi -$as_echo "#define HAVE_IN_PORT_T 1" >>confdefs.h +for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_addr_t definition" >&5 -$as_echo_n "checking for in_addr_t definition... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } +if ${ac_cv_sys_largefile_source+:} false; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include -#include - +#include /* for off_t */ + #include int main () { - in_addr_t pt; pt = 0; return pt; +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_IN_ADDR_T 1" >>confdefs.h - - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=no; break fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -case "$target_os" in -linux*) - -$as_echo "#define C_LINUX 1" >>confdefs.h +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_sys_largefile_source=1; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 +$as_echo "$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -rf conftest* - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - if test "$want_fanotify" = "yes"; then - ac_fn_c_check_header_mongrel "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_fanotify_h" = xyes; then : +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then -$as_echo "#define FANOTIFY 1" >>confdefs.h +$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi - fi - fi - ;; -kfreebsd*-gnu) -$as_echo "#define C_KFREEBSD_GNU 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +$as_echo_n "checking for working mmap... " >&6; } +if ${ac_cv_c_mmap_private+:} false; then : + $as_echo_n "(cached) " >&6 +else - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - ;; -solaris*) - CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lresolv" - FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv" - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - CLAMD_LIBS="$CLAMD_LIBS -lresolv" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lresolv" - TH_SAFE="-thread-safe" - fi + if test "$cross_compiling" = yes; then : + ac_cv_c_mmap_private=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -$as_echo "#define C_SOLARIS 1" >>confdefs.h +#include +#include +#include +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#include +int main(void) +{ + char *data, *data2, *data3; + unsigned i, datasize = 1024; + int fd; - ;; -freebsd[45]*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread -lc_r" - TH_SAFE="-thread-safe" - fi + /* First, make a file with some known garbage in it. */ + data = (char*) malloc(datasize); + if(!data) + return 1; + for(i=0;i>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_mmap_private" >&5 +$as_echo "$ac_cv_c_mmap_private" >&6; } +if test $ac_cv_c_mmap_private = yes; then - ;; -freebsd*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lthr" - TH_SAFE="-thread-safe" - fi +$as_echo "#define HAVE_MMAP 1" >>confdefs.h -$as_echo "#define C_BSD 1" >>confdefs.h +fi +rm -f conftest.mmap - ;; -dragonfly*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - TH_SAFE="-thread-safe" - fi -$as_echo "#define C_BSD 1" >>confdefs.h - - ;; -openbsd*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - CLAMD_LIBS="$CLAMD_LIBS -pthread" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" - TH_SAFE="-thread-safe" - fi - -$as_echo "#define C_BSD 1" >>confdefs.h - - ;; -bsdi*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - TH_SAFE="-thread-safe" - fi - -$as_echo "#define C_BSD 1" >>confdefs.h - - ;; -netbsd*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - fi - -$as_echo "#define C_BSD 1" >>confdefs.h - - ;; -bsd*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown BSD detected. Disabling thread support." >&5 -$as_echo "Unknown BSD detected. Disabling thread support." >&6; } - have_pthreads="no" - -$as_echo "#define C_BSD 1" >>confdefs.h - - ;; -beos*) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: BeOS detected. Disabling thread support." >&5 -$as_echo "BeOS detected. Disabling thread support." >&6; } - have_pthreads="no" - -$as_echo "#define C_BEOS 1" >>confdefs.h - - ;; -x86:Interix*) - -$as_echo "#define C_INTERIX 1" >>confdefs.h - - ;; -darwin*) - -$as_echo "#define C_BSD 1" >>confdefs.h - - -$as_echo "#define C_DARWIN 1" >>confdefs.h - - -$as_echo "#define BIND_8_COMPAT 1" >>confdefs.h - - -$as_echo "#define CLAMAUTH 1" >>confdefs.h - - use_netinfo="yes" - ;; -os2*) - CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lsyslog" - FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsyslog" - CLAMD_LIBS="$CLAMD_LIBS -lsyslog" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsyslog" - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - -$as_echo "#define C_OS2 1" >>confdefs.h - - ;; -sco*) - ;; -hpux*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - -$as_echo "#define C_HPUX 1" >>confdefs.h - - if test "$have_mempool" = "yes"; then - LDFLAGS="$LDFLAGS -Wl,+pd,1M" - fi - ;; -aix*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - -$as_echo "#define _THREAD_SAFE 1" >>confdefs.h - - fi - -$as_echo "#define C_AIX 1" >>confdefs.h - - ;; -*-*-osf*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - TH_SAFE="-thread-safe" - -$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h - - fi - -$as_echo "#define C_OSF 1" >>confdefs.h - - ;; -nto-qnx*) - -$as_echo "#define C_QNX6 1" >>confdefs.h - - ;; -irix*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - LIBS="$LIBS -lgen" - -$as_echo "#define C_IRIX 1" >>confdefs.h - - ;; -interix*) - -$as_echo "#define C_INTERIX 1" >>confdefs.h - - if test "$test_clamav" = "yes"; then - if test ! -r /etc/passwd; then - test_clamav="no" - fi - fi - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - ;; -gnu*) - -$as_echo "#define C_GNU_HURD 1" >>confdefs.h - - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - ;; -*) - ;; -esac +ac_cv_c_can_get_pagesize="no" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysconf(_SC_PAGESIZE)" >&5 +$as_echo_n "checking for sysconf(_SC_PAGESIZE)... " >&6; } +if ${ac_cv_c_sysconf_sc_pagesize+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if HAVE_UNISTD_H +#include +#endif +int +main () +{ +int x = sysconf(_SC_PAGESIZE); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_c_sysconf_sc_pagesize=yes +else + ac_cv_c_sysconf_sc_pagesize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_sysconf_sc_pagesize" >&5 +$as_echo "$ac_cv_c_sysconf_sc_pagesize" >&6; } +if test "$ac_cv_c_sysconf_sc_pagesize" = "yes"; then +$as_echo "#define HAVE_SYSCONF_SC_PAGESIZE 1" >>confdefs.h + ac_cv_c_can_get_pagesize="yes" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize()" >&5 +$as_echo_n "checking for getpagesize()... " >&6; } +if ${ac_cv_c_getpagesize+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if HAVE_UNISTD_H +#include +#endif +int +main () +{ +int x = getpagesize(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_c_getpagesize=yes +else + ac_cv_c_getpagesize=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_getpagesize" >&5 +$as_echo "$ac_cv_c_getpagesize" >&6; } +if test "$ac_cv_c_getpagesize" = "yes"; then +$as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h + ac_cv_c_can_get_pagesize="yes" +fi -if test "$have_milter" = "yes"; then - save_LIBS="$LIBS" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" - if test -d /usr/lib/libmilter ; then - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter" - fi - LIBS="$LIBS -lmilter $CLAMAV_MILTER_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mi_stop in -lmilter" >&5 -$as_echo_n "checking for mi_stop in -lmilter... " >&6; } -if ${ac_cv_lib_milter_mi_stop+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANON(YMOUS)" >&5 +$as_echo_n "checking for MAP_ANON(YMOUS)... " >&6; } +if ${ac_cv_c_mmap_anonymous+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmilter $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char mi_stop (); + ac_cv_c_mmap_anonymous='no' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include int main () { -return mi_stop (); +mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_milter_mi_stop=yes -else - ac_cv_lib_milter_mi_stop=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_milter_mi_stop" >&5 -$as_echo "$ac_cv_lib_milter_mi_stop" >&6; } -if test "x$ac_cv_lib_milter_mi_stop" = xyes; then : - CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_LIBS" + ac_cv_c_mmap_anonymous='MAP_ANONYMOUS' else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strlcpy" >&5 -$as_echo_n "checking for library containing strlcpy... " >&6; } -if ${ac_cv_search_strlcpy+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char strlcpy (); +/* OPENBSD WORKAROUND - DND*/ +#include +/* OPENBSD WORKAROUND - END*/ +#include + int main () { -return strlcpy (); +mmap((void *)0, 0, PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0); ; return 0; } _ACEOF -for ac_lib in '' sm smutil; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_strlcpy=$ac_res +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_c_mmap_anonymous='MAP_ANON' + fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_strlcpy+:} false; then : - break -fi -done -if ${ac_cv_search_strlcpy+:} false; then : + conftest$ac_exeext conftest.$ac_ext + -else - ac_cv_search_strlcpy=no fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strlcpy" >&5 -$as_echo "$ac_cv_search_strlcpy" >&6; } -ac_res=$ac_cv_search_strlcpy -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - test "$ac_cv_search_strlcpy" = "none required" || CLAMAV_MILTER_XLIB="$ac_cv_search_strlcpy" -fi - - LIBS="$save_LIBS $CLAMAV_MILTER_LIBS $CLAMAV_MILTER_XLIB" - $as_unset ac_cv_lib_milter_mi_stop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mi_stop in -lmilter" >&5 -$as_echo_n "checking for mi_stop in -lmilter... " >&6; } -if ${ac_cv_lib_milter_mi_stop+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmilter $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char mi_stop (); -int -main () -{ -return mi_stop (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_milter_mi_stop=yes -else - ac_cv_lib_milter_mi_stop=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_milter_mi_stop" >&5 -$as_echo "$ac_cv_lib_milter_mi_stop" >&6; } -if test "x$ac_cv_lib_milter_mi_stop" = xyes; then : - CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_XLIB $CLAMAV_MILTER_LIBS" -else - - as_fn_error $? "Cannot find libmilter" "$LINENO" 5 - -fi - - -fi - - LIBS="$save_LIBS" - for ac_header in libmilter/mfapi.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libmilter/mfapi.h" "ac_cv_header_libmilter_mfapi_h" "$ac_includes_default" -if test "x$ac_cv_header_libmilter_mfapi_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBMILTER_MFAPI_H 1 -_ACEOF - have_milter="yes" -else - - as_fn_error $? "Please install mfapi.h from the sendmail distribution" "$LINENO" 5 - -fi - -done - -fi - - if test "$have_pthreads" = "yes"; then - BUILD_CLAMD_TRUE= - BUILD_CLAMD_FALSE='#' -else - BUILD_CLAMD_TRUE='#' - BUILD_CLAMD_FALSE= -fi - - if test "$have_milter" = "yes"; then - HAVE_MILTER_TRUE= - HAVE_MILTER_FALSE='#' -else - HAVE_MILTER_TRUE='#' - HAVE_MILTER_FALSE= -fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_mmap_anonymous" >&5 +$as_echo "$ac_cv_c_mmap_anonymous" >&6; } + if test "$ac_cv_c_mmap_anonymous" != "no"; then -if test "$have_pthreads" = "yes" -then - save_LIBS="$LIBS" - LIBS="$THREAD_LIBS $LIBS" - for ac_func in sched_yield pthread_yield -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define ANONYMOUS_MAP $ac_cv_c_mmap_anonymous _ACEOF -fi -done - - LIBS="$save_LIBS" - -$as_echo "#define BUILD_CLAMD 1" >>confdefs.h - - -$as_echo "#define CL_THREAD_SAFE 1" >>confdefs.h - - -$as_echo "#define _REENTRANT 1" >>confdefs.h + fi -fi for ac_func in enable_extended_FILE_stdio do : @@ -18346,1173 +15406,4820 @@ fi done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for readdir_r" >&5 -$as_echo_n "checking for readdir_r... " >&6; } -if test -z "$ac_cv_readdir_args"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - - struct dirent dir, *dirp; - DIR *mydir; - dirp = readdir_r(mydir, &dir); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_readdir_args=2 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Check whether --enable-mempool was given. +if test "${enable_mempool+set}" = set; then : + enableval=$enable_mempool; enable_mempool=$enableval +else + enable_mempool="yes" fi -if test -z "$ac_cv_readdir_args"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -int -main () -{ +have_mempool="no" +if test "$enable_mempool" = "yes"; then + if test "$ac_cv_c_mmap_private" != "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (mmap not available or not usable)" >&5 +$as_echo "$as_me: ****** mempool support disabled (mmap not available or not usable)" >&6;} + else + if test "$ac_cv_c_can_get_pagesize" != "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (pagesize cannot be determined)" >&5 +$as_echo "$as_me: ****** mempool support disabled (pagesize cannot be determined)" >&6;} + else + if test "$ac_cv_c_mmap_anonymous" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: ****** mempool support disabled (anonymous mmap not available)" >&5 +$as_echo "$as_me: ****** mempool support disabled (anonymous mmap not available)" >&6;} + else - struct dirent dir, *dirp; - DIR *mydir; - int rc; - rc = readdir_r(mydir, &dir, &dirp); +$as_echo "#define USE_MPOOL 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_readdir_args=3 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + have_mempool="yes" + fi + fi + fi fi -# Check whether --enable-readdir_r was given. -if test "${enable_readdir_r+set}" = set; then : - enableval=$enable_readdir_r; enable_readdir_r=$enableval +enable_check_ut=auto +enable_ut_install=no +# Check whether --enable-check was given. +if test "${enable_check+set}" = set; then : + enableval=$enable_check; enable_check_ut=$enableval else - enable_readdir_r="no" + enable_check_ut="auto" fi -if test "$enable_readdir_r" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: support disabled" >&5 -$as_echo "support disabled" >&6; } -elif test -z "$ac_cv_readdir_args"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -else - if test "$ac_cv_readdir_args" = 2; then - -$as_echo "#define HAVE_READDIR_R_2 1" >>confdefs.h +if test "$enable_check_ut" != "no" ; then - elif test "$ac_cv_readdir_args" = 3; then + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_save_prefix" -$as_echo "#define HAVE_READDIR_R_3 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes $ac_cv_readdir_args arguments" >&5 -$as_echo "yes, and it takes $ac_cv_readdir_args arguments" >&6; } +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctime_r" >&5 -$as_echo_n "checking for ctime_r... " >&6; } -if test "$ac_cv_func_ctime_r" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - char buf[31]; - time_t t; - ctime_r(&t, buf, 30); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - ac_cv_ctime_args=3 - -$as_echo "#define HAVE_CTIME_R_3 1" >>confdefs.h - - +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5 +$as_echo_n "checking for ld used by GCC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${acl_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break ;; + *) + test "$with_gnu_ld" != yes && break ;; + esac + fi + done + IFS="$ac_save_ifs" +else + acl_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi - ac_cv_ctime_args=2 - -$as_echo "#define HAVE_CTIME_R_2 1" >>confdefs.h +LD="$acl_cv_path_LD" +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${acl_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$acl_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$acl_cv_prog_gnu_ld -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes $ac_cv_ctime_args arguments" >&5 -$as_echo "yes, and it takes $ac_cv_ctime_args arguments" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 -$as_echo_n "checking for socklen_t... " >&6; } -if ${ac_cv_socklen_t+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 +$as_echo_n "checking for shared library run path origin... " >&6; } +if ${acl_cv_rpath+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_socklen_t=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done - #include - #include +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 +$as_echo "$acl_cv_rpath" >&6; } + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + # Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; : +else + enable_rpath=yes +fi -int -main () -{ - socklen_t len; - getpeername(0,0,&len); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_socklen_t=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_socklen_t" >&5 -$as_echo "$ac_cv_socklen_t" >&6; } - if test $ac_cv_socklen_t = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 -$as_echo_n "checking for socklen_t equivalent... " >&6; } - if ${ac_cv_socklen_t_equiv+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_socklen_t_equiv=int - for t in int size_t unsigned long "unsigned long"; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #include - #include -int -main () -{ + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" - $t len; - getpeername(0,0,&len); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_socklen_t_equiv="$t" - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done + use_additional=yes -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_socklen_t_equiv" >&5 -$as_echo "$ac_cv_socklen_t_equiv" >&6; } + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" -cat >>confdefs.h <<_ACEOF -#define socklen_t $ac_cv_socklen_t_equiv -_ACEOF + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -fi -if test "$test_clamav" = "yes" -then - if test "$use_id" = "no" - then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user in /etc/passwd" >&5 -$as_echo_n "checking for $clamav_user in /etc/passwd... " >&6; } - if test -r /etc/passwd; then - clamavuser=`cat /etc/passwd|grep "^$clamav_user:"` - clamavgroup=`cat /etc/group|grep "^$clamav_group:"` - fi +# Check whether --with-libcheck-prefix was given. +if test "${with_libcheck_prefix+set}" = set; then : + withval=$with_libcheck_prefix; + if test "X$withval" = "Xno"; then + use_additional=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using id" >&5 -$as_echo_n "checking for $clamav_user using id... " >&6; } - id $clamav_user > /dev/null 2>&1 - if test "$?" = 0 ; then - clamavuser=1 - # Extract the first word of "getent", so it can be a program name with args. -set dummy getent; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GETENT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $GETENT in - [\\/]* | ?:[\\/]*) - ac_cv_path_GETENT="$GETENT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GETENT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + additional_compat_libdir= + if test "X$withval" = "X"; then - ;; -esac -fi -GETENT=$ac_cv_path_GETENT -if test -n "$GETENT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GETENT" >&5 -$as_echo "$GETENT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" - if test -n "$GETENT" ; then - clamavgroup=`$GETENT group | grep "^${clamav_group}:"` - else - clamavgroup=`cat /etc/group|grep $clamav_group` - fi - fi - fi + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - if test "$use_netinfo" = "yes" - then - if test -x /usr/bin/dscl; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using dscl" >&5 -$as_echo_n "checking for $clamav_user using dscl... " >&6; } - clamavuser=`/usr/bin/dscl . -list /Users |grep ${clamav_user}` - clamavgroup=`/usr/bin/dscl . -list /Groups |grep ${clamav_group}` - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using netinfo" >&5 -$as_echo_n "checking for $clamav_user using netinfo... " >&6; } - clamavuser=`/usr/bin/nidump passwd . |grep ${clamav_user}` - clamavgroup=`/usr/bin/nidump group . |grep ${clamav_group}` + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "X$acl_libdirstem" != "Xlib"; then + additional_compat_libdir="-L$withval/lib" fi + fi fi - if test "$use_yp" = "yes" - then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using ypmatch" >&5 -$as_echo_n "checking for $clamav_user using ypmatch... " >&6; } - clamavuser=`ypmatch ${clamav_user} passwd` - clamavgroup=`ypmatch ${clamav_group} group` - fi - - if test -z "$clamavuser" || test -z "$clamavgroup" - then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "User $clamav_user (and/or group $clamav_group) does not exist. Please read the documentation !" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, user $clamav_user and group $clamav_group" >&5 -$as_echo "yes, user $clamav_user and group $clamav_group" >&6; } - CLAMAVUSER="$clamav_user" - CLAMAVGROUP="$clamav_group" +fi + LIBCHECK= + LTLIBCHECK= + INCCHECK= + LIBCHECK_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='check ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + compat_libdir= + if test "X$acl_libdirstem" != "Xlib"; then + compat_libdir=-L'${exec_prefix}'/lib + fi + for x in $LDFLAGS $LTLIBCHECK $compat_libdir $additional_compat_libdir; do - fi -fi + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for structure packing via __attribute__((packed))" >&5 -$as_echo_n "checking for structure packing via __attribute__((packed))... " >&6; } -if ${have_cv_attrib_packed+:} false; then : - $as_echo_n "(cached) " >&6 -else + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBCHECK; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_so" + else + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$found_a" + else + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBCHECK_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/lib/"'*$,,'` + LIBCHECK_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCCHECK; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCCHECK="${INCCHECK}${INCCHECK:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBCHECK; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBCHECK; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$dep" + LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }$dep" + ;; + esac + done + fi + else + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }-l$name" + LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBCHECK="${LIBCHECK}${LIBCHECK:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBCHECK="${LTLIBCHECK}${LTLIBCHECK:+ }-R$found_dir" + done + fi + + CPPFLAGS="$CPPFLAGS $INCCHECK" + ac_fn_c_check_header_mongrel "$LINENO" "check.h" "ac_cv_header_check_h" "$ac_includes_default" +if test "x$ac_cv_header_check_h" = xyes; then : + have_header=yes +else + have_header=no +fi + + + ac_cv_findlib_CHECK_libs= + ac_cv_findlib_CHECK_ltlibs= + ac_cv_findlib_CHECK_inc= + if test "$have_header" = "yes"; then : + + LIBS="$LIBS $LIBCHECK" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking with check" >&5 +$as_echo_n "checking linking with check... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include int main () { -#ifdef __GNUC__ - struct { int i __attribute__((packed)); } s; - #else - #error Only checking for packed attribute on gcc-like compilers - #endif +srunner_create(0) ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_cv_attrib_packed=yes -else - have_cv_attrib_packed=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + + ac_cv_findlib_CHECK_libs="$LIBCHECK" + ac_cv_findlib_CHECK_ltlibs="$LTLIBCHECK" + ac_cv_findlib_CHECK_inc="$INCCHECK" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_attrib_packed" >&5 -$as_echo "$have_cv_attrib_packed" >&6; } +fi + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + if test "X$ac_cv_findlib_CHECK_libs" = "X"; then : -if test "$have_cv_attrib_packed" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for structure packing via pragma" >&5 -$as_echo_n "checking for structure packing via pragma... " >&6; } - if ${have_cv_pragma_pack+:} false; then : - $as_echo_n "(cached) " >&6 -else + { $as_echo "$as_me:${as_lineno-$LINENO}: unable to compile/link with check" >&5 +$as_echo "$as_me: unable to compile/link with check" >&6;} + HAVE_LIBCHECK=no - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - int main(int argc, char **argv) { -#pragma pack(1) /* has to be in column 1 ! */ - struct { char c; long l; } s; - return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - have_cv_pragma_pack=yes else - have_cv_pragma_pack=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with check by using $ac_cv_findlib_CHECK_inc $ac_cv_findlib_CHECK_libs" >&5 +$as_echo "$as_me: Compiling and linking with check by using $ac_cv_findlib_CHECK_inc $ac_cv_findlib_CHECK_libs" >&6;} -fi +$as_echo "#define HAVE_LIBCHECK 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_pragma_pack" >&5 -$as_echo "$have_cv_pragma_pack" >&6; } - if test "$have_cv_pragma_pack" = yes; then + HAVE_LIBCHECK=yes + LIBCHECK="$ac_cv_findlib_CHECK_libs" + LTLIBCHECK="$ac_cv_findlib_CHECK_ltlibs" + INCCHECK="$ac_cv_findlib_CHECK_inc" + CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK" -$as_echo "#define HAVE_PRAGMA_PACK 1" >>confdefs.h +fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for structure packing via hppa/hp-ux pragma" >&5 -$as_echo_n "checking for structure packing via hppa/hp-ux pragma... " >&6; } - if ${have_cv_pragma_pack_hpux+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi - /* hppa/hp-ux wants pragma outside of function */ -#pragma pack 1 /* has to be in column 1 ! */ - struct { char c; long l; } s; - int main(int argc, char **argv) { - return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - have_cv_pragma_pack_hpux=yes + + if test "X$HAVE_LIBCHECK" = "Xyes"; then + HAVE_LIBCHECK_TRUE= + HAVE_LIBCHECK_FALSE='#' else - have_cv_pragma_pack_hpux=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + HAVE_LIBCHECK_TRUE='#' + HAVE_LIBCHECK_FALSE= fi +if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then + as_fn_error $? " + +ERROR! Check was configured, but not found. Get it from http://check.sf.net/ +" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_pragma_pack_hpux" >&5 -$as_echo "$have_cv_pragma_pack_hpux" >&6; } +# Check whether --enable-coverage was given. +if test "${enable_coverage+set}" = set; then : + enableval=$enable_coverage; enable_cov=$enableval +else + enable_cov="no" +fi -$as_echo "#define HAVE_PRAGMA_PACK_HPPA 1" >>confdefs.h +if test "x$enable_coverage" = "xyes"; then + if test "x$CHECK_LIBS" = "x"; then + as_fn_error $? "Coverage testing required, but unit tests not enabled!" "$LINENO" 5 + fi + if test "x$ac_compiler_gnu" != "xyes"; then + as_fn_error $? "coverage testing only works if gcc is used" "$LINENO" 5 fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type aligning via __attribute__((aligned))" >&5 -$as_echo_n "checking for type aligning via __attribute__((aligned))... " >&6; } -if ${have_cv_attrib_aligned+:} false; then : + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -lgcov" + for ac_prog in gcov +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GCOV+:} false; then : $as_echo_n "(cached) " >&6 else + if test -n "$GCOV"; then + ac_cv_prog_GCOV="$GCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GCOV="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -typedef int cl_aligned_int __attribute__((aligned)); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_cv_attrib_aligned=yes +fi +fi +GCOV=$ac_cv_prog_GCOV +if test -n "$GCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 +$as_echo "$GCOV" >&6; } else - have_cv_attrib_aligned=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_attrib_aligned" >&5 -$as_echo "$have_cv_attrib_aligned" >&6; } + test -n "$GCOV" && break +done +test -n "$GCOV" || GCOV="false" -if test "$have_cv_attrib_packed" = no -a "$have_cv_pragma_pack" = no -a "$have_cv_pragma_pack_hpux" = no; then - as_fn_error $? "Need to know how to pack structures with this compiler" "$LINENO" 5 + for ac_prog in lcov +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LCOV+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LCOV"; then + ac_cv_prog_LCOV="$LCOV" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LCOV="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LCOV=$ac_cv_prog_LCOV +if test -n "$LCOV"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 +$as_echo "$LCOV" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test "$have_cv_attrib_packed" = yes; then -$as_echo "#define HAVE_ATTRIB_PACKED 1" >>confdefs.h + test -n "$LCOV" && break +done +test -n "$LCOV" || LCOV="false" + + for ac_prog in genhtml +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GENHTML+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GENHTML"; then + ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_GENHTML="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +GENHTML=$ac_cv_prog_GENHTML +if test -n "$GENHTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 +$as_echo "$GENHTML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test "$have_cv_attrib_aligned" = yes; then -$as_echo "#define HAVE_ATTRIB_ALIGNED 1" >>confdefs.h + test -n "$GENHTML" && break +done +test -n "$GENHTML" || GENHTML="false" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that structure packing works" >&5 -$as_echo_n "checking that structure packing works... " >&6; } -if ${have_cv_struct_pack+:} false; then : - $as_echo_n "(cached) " >&6 + if test "x$enable_coverage" = "xyes"; then + ENABLE_COVERAGE_TRUE= + ENABLE_COVERAGE_FALSE='#' else + ENABLE_COVERAGE_TRUE='#' + ENABLE_COVERAGE_FALSE= +fi - if test "$cross_compiling" = yes; then : - have_cv_struct_pack=yes -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef HAVE_ATTRIB_PACKED -#define __attribute__(x) -#endif -#ifdef HAVE_PRAGMA_PACK -#pragma pack(1) /* has to be in column 1 ! */ -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack 1 /* has to be in column 1 ! */ -#endif -struct { char c __attribute__((packed)); long l __attribute__((packed)); } s; +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi -#ifdef HAVE_PRAGMA_PACK -#pragma pack() -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack -#endif + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi -struct { char c; long l;} s2; + MAINT=$MAINTAINER_MODE_TRUE -#ifdef HAVE_PRAGMA_PACK -#pragma pack(1) /* has to be in column 1 ! */ -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack 1 /* has to be in column 1 ! */ -#endif -struct { char c; long l; } __attribute__((packed)) s3; -#ifdef HAVE_PRAGMA_PACK -#pragma pack() -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack -#endif +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib installation" >&5 +$as_echo_n "checking for zlib installation... " >&6; } - int main(int argc, char **argv) { - if (sizeof(s)!=sizeof(s.c)+sizeof(s.l)) - return 1; - if (sizeof(s) != sizeof(s3)) - return 2; - return (sizeof(s2) >= sizeof(s)) ? 0 : 3; - } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - have_cv_struct_pack=yes -else - have_cv_struct_pack=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +# Check whether --with-zlib was given. +if test "${with_zlib+set}" = set; then : + withval=$with_zlib; +if test "$withval"; then + ZLIB_HOME="$withval" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using $ZLIB_HOME" >&5 +$as_echo "using $ZLIB_HOME" >&6; } fi +else +ZLIB_HOME=/usr/local +if test ! -f "$ZLIB_HOME/include/zlib.h" +then + ZLIB_HOME=/usr fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZLIB_HOME" >&5 +$as_echo "$ZLIB_HOME" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_struct_pack" >&5 -$as_echo "$have_cv_struct_pack" >&6; } - -if test "$have_cv_struct_pack" = "no"; then - as_fn_error $? "Structure packing seems to be available, but is not working with this compiler" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_set" >&5 -$as_echo_n "checking for fd_set... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fd_mask" >/dev/null 2>&1; then : - have_fd_set=yes +CLAMDSCAN_LIBS="$FRESHCLAM_LIBS" + +# Check whether --enable-zlib-vcheck was given. +if test "${enable_zlib_vcheck+set}" = set; then : + enableval=$enable_zlib_vcheck; zlib_check=$enableval +else + zlib_check="yes" fi -rm -f conftest* -if test "$have_fd_set" = yes; then -$as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h +if test ! -f "$ZLIB_HOME/include/zlib.h" +then + as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5 +else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in sys/select.h" >&5 -$as_echo "yes, found in sys/select.h" >&6; } + vuln=`grep "ZLIB_VERSION \"1.2.0" $ZLIB_HOME/include/zlib.h` + if test -z "$vuln"; then + vuln=`grep "ZLIB_VERSION \"1.2.1" $ZLIB_HOME/include/zlib.h` + fi + + if test -n "$vuln"; then + if test "$zlib_check" = "yes"; then + as_fn_error $? "The installed zlib version may contain a security bug. Please upgrade to 1.2.2 or later: http://www.zlib.net. You can omit this check with --disable-zlib-vcheck but DO NOT REPORT any stability issues then!" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** This ClamAV installation may be linked against" >&5 +$as_echo "$as_me: WARNING: ****** This ClamAV installation may be linked against" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** a broken zlib version. Please DO NOT report any" >&5 +$as_echo "$as_me: WARNING: ****** a broken zlib version. Please DO NOT report any" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** stability problems to the ClamAV developers!" >&5 +$as_echo "$as_me: WARNING: ****** stability problems to the ClamAV developers!" >&2;} + fi + fi + + save_LIBS="$LIBS" + if test "$ZLIB_HOME" != "/usr"; then + CPPFLAGS="$CPPFLAGS -I$ZLIB_HOME/include" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$ZLIB_HOME/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 +$as_echo_n "checking for inflateEnd in -lz... " >&6; } +if ${ac_cv_lib_z_inflateEnd+:} false; then : + $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #include - #ifdef HAVE_UNISTD_H - #include - #endif + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inflateEnd (); int main () { -fd_set readMask, writeMask; +return inflateEnd (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_fd_set=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_inflateEnd=yes else - have_fd_set=no + ac_cv_lib_z_inflateEnd=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$have_fd_set" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in sys/types.h" >&5 -$as_echo "yes, found in sys/types.h" >&6; } - else - -$as_echo "#define NO_FD_SET 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 +$as_echo "$ac_cv_lib_z_inflateEnd" >&6; } +if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$ZLIB_HOME/lib -lz"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$ZLIB_HOME/lib -lz" +else + as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default FD_SETSIZE value" >&5 -$as_echo_n "checking default FD_SETSIZE value... " >&6; } -if test "$cross_compiling" = yes; then : - DEFAULT_FD_SETSIZE=256 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 +$as_echo_n "checking for gzopen in -lz... " >&6; } +if ${ac_cv_lib_z_gzopen+:} false; then : + $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#include -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif -#include -int main(void) { - FILE *fp = fopen("conftestval", "w"); - if(fp) { - if(fprintf (fp, "%d\n", FD_SETSIZE) < 1) { - perror("fprintf failed"); - return errno; - } - } else { - perror("fopen failed"); - return errno; - } - return 0; +char gzopen (); +int +main () +{ +return gzopen (); + ; + return 0; } - _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - DEFAULT_FD_SETSIZE=`cat conftestval` +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_gzopen=yes else - DEFAULT_FD_SETSIZE=256 + ac_cv_lib_z_gzopen=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_FD_SETSIZE" >&5 -$as_echo "$DEFAULT_FD_SETSIZE" >&6; } - -cat >>confdefs.h <<_ACEOF -#define DEFAULT_FD_SETSIZE $DEFAULT_FD_SETSIZE +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5 +$as_echo "$ac_cv_lib_z_gzopen" >&6; } +if test "x$ac_cv_lib_z_gzopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 _ACEOF + LIBS="-lz $LIBS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stat64" >&5 -$as_echo_n "checking stat64... " >&6; } -if test "$cross_compiling" = yes; then : - enable_stat64=no else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + as_fn_error $? "Your zlib is missing gzopen()" "$LINENO" 5 +fi -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE -#include -#include -#include -#include -#include - -int main(void) { - struct stat64 sb; - - if (stat64(".", &sb) == -1) - return errno; + LDFLAGS="$save_LDFLAGS" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5 +$as_echo_n "checking for inflateEnd in -lz... " >&6; } +if ${ac_cv_lib_z_inflateEnd+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - return 0; +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inflateEnd (); +int +main () +{ +return inflateEnd (); + ; + return 0; } - _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - enable_stat64=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_inflateEnd=yes else - enable_stat64=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_lib_z_inflateEnd=no fi - - -if test "$enable_stat64" != "no"; then - -$as_echo "#define HAVE_STAT64 1" >>confdefs.h - -CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_stat64" >&5 -$as_echo "$enable_stat64" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signed right shift is sign extended" >&5 -$as_echo_n "checking whether signed right shift is sign extended... " >&6; } -if test "$cross_compiling" = yes; then : - have_signed_rightshift_extended=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(void){int a=-1;int b=a>>1;return(a!=b);} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - have_signed_rightshift_extended=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5 +$as_echo "$ac_cv_lib_z_inflateEnd" >&6; } +if test "x$ac_cv_lib_z_inflateEnd" = xyes; then : + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz";FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lz" else - have_signed_rightshift_extended=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -if test $have_signed_rightshift_extended = yes; then - -$as_echo "#define HAVE_SAR 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_signed_rightshift_extended" >&5 -$as_echo "$have_signed_rightshift_extended" >&6; }; - - -for ac_func in recvmsg sendmsg -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - + as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5 fi -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for msg_control field in struct msghdr" >&5 -$as_echo_n "checking for msg_control field in struct msghdr... " >&6; } -if ${ac_cv_have_control_in_msghdr+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 +$as_echo_n "checking for gzopen in -lz... " >&6; } +if ${ac_cv_lib_z_gzopen+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _XOPEN_SOURCE 500 -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include -#ifdef HAVE_SYS_UIO_H -#include +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif - +char gzopen (); int main () { - -#ifdef msg_control -#error msg_control defined -#endif -struct msghdr m; -m.msg_control = 0; -return 0; - +return gzopen (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_control_in_msghdr="yes" +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_gzopen=yes else - ac_cv_have_control_in_msghdr="no" + ac_cv_lib_z_gzopen=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_control_in_msghdr" >&5 -$as_echo "$ac_cv_have_control_in_msghdr" >&6; } -if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking BSD 4.4 / RFC2292 style fd passing" >&5 -$as_echo_n "checking BSD 4.4 / RFC2292 style fd passing... " >&6; } - # Check whether --enable-fdpassing was given. -if test "${enable_fdpassing+set}" = set; then : - enableval=$enable_fdpassing; want_fdpassing=$enableval +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5 +$as_echo "$ac_cv_lib_z_gzopen" >&6; } +if test "x$ac_cv_lib_z_gzopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + else - want_fdpassing="yes" + as_fn_error $? "Your zlib is missing gzopen()" "$LINENO" 5 +fi + + fi + LIBS="$save_LIBS" fi - if test "x$want_fdpassing" = "xyes"; then - if test "$cross_compiling" = yes; then : - have_fdpass=0 +# Check whether --enable-bzip2 was given. +if test "${enable_bzip2+set}" = set; then : + enableval=$enable_bzip2; want_bzip2=$enableval else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + want_bzip2="yes" +fi +bzip_check="ok" +if test "$want_bzip2" = "yes" +then -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_UIO_H -#include -#endif -#include -#include -#if !defined CMSG_SPACE || !defined CMSG_LEN -#ifndef ALIGN -#define ALIGN(len) len -#endif -#ifndef CMSG_SPACE -#define CMSG_SPACE(len) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(len)) -#endif -#ifndef CMSG_LEN -#define CMSG_LEN(len) (ALIGN(sizeof(struct cmsghdr)) + len) -#endif -#endif -#define TEST "test" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libbz2" >&5 +$as_echo_n "checking how to link with libbz2... " >&6; } +if ${ac_cv_libbz2_libs+:} false; then : + $as_echo_n "(cached) " >&6 +else -static int send_fd(int s, int fd) -{ - struct msghdr msg; - struct cmsghdr *cmsg; - unsigned char fdbuf[CMSG_SPACE(sizeof(int))]; - struct iovec iov[1]; - char dummy[] = ""; - iov[0].iov_base = dummy; - iov[0].iov_len = 1; - memset(&msg, 0, sizeof(msg)); - msg.msg_control = fdbuf; - /* must send/receive at least one byte */ - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_controllen = CMSG_LEN(sizeof(int)); - cmsg = CMSG_FIRSTHDR(&msg); - cmsg->cmsg_len = CMSG_LEN(sizeof(int)); - cmsg->cmsg_level = SOL_SOCKET; - cmsg->cmsg_type = SCM_RIGHTS; - *(int *)CMSG_DATA(cmsg) = fd; - if (sendmsg(s, &msg, 0) == -1) { - perror("sendmsg"); - close(s); - return -1; - } - return 0; -} + use_additional=yes -static int testfd(int desc) -{ - char buf[256]; - if(read(desc, buf, sizeof(buf)) != sizeof(TEST)) { - fprintf(stderr, "test data not received correctly!"); - return 1; - } - return memcmp(buf, TEST, sizeof(TEST)); -} + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" -static int recv_fd(int desc) -{ - unsigned char buf[CMSG_SPACE(sizeof(int))]; - struct msghdr msg; - struct cmsghdr *cmsg; - struct iovec iov[1]; - char dummy; - int ret=2; + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" - memset(&msg, 0, sizeof(msg)); - iov[0].iov_base = &dummy; - iov[0].iov_len = 1; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_control = buf; - msg.msg_controllen = sizeof(buf); + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - if (recvmsg(desc, &msg, 0) == -1) { - perror("recvmsg failed!"); - return -1; - } - if ((msg.msg_flags & MSG_TRUNC) || (msg.msg_flags & MSG_CTRUNC)) { - fprintf(stderr, "control message truncated"); - return -1; - } - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_len == CMSG_LEN(sizeof(int)) && - cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_RIGHTS) { - int fd = *(int *)CMSG_DATA(cmsg); - ret = testfd(fd); - close(fd); - } - } - return ret; -} -int main(void) -{ - int fd[2]; - int pip[2]; - pid_t pid; - int status; +# Check whether --with-libbz2-prefix was given. +if test "${with_libbz2_prefix+set}" = set; then : + withval=$with_libbz2_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + additional_compat_libdir= + if test "X$withval" = "X"; then - if(pipe(pip)) { - perror("pipe"); - return 1; - } + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" - if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) { - perror("socketpair"); - return 1; - } + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" - if((pid=fork()) < 0) { - perror("fork"); - } else if (!pid) { - exit( recv_fd(fd[1]) ); - } else { - /* parent */ - if(send_fd(fd[0], pip[0]) == -1) { - kill(pid, 9); - waitpid(pid, NULL, 0); - return 2; - } - if(write(pip[1], TEST, sizeof(TEST)) != sizeof(TEST)) { - close(pip[1]); - return -1; - } - close(pip[1]); - waitpid(pid, &status, 0); - } - return status; -} + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "X$acl_libdirstem" != "Xlib"; then + additional_compat_libdir="-L$withval/lib" + fi + fi + fi -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - have_fdpass=1; fdpass_need_xopen=0 -else - have_fdpass=0 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext fi + LIBBZ2= + LTLIBBZ2= + INCBZ2= + LIBBZ2_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='bz2 ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + compat_libdir= + if test "X$acl_libdirstem" != "Xlib"; then + compat_libdir=-L'${exec_prefix}'/lib + fi + for x in $LDFLAGS $LTLIBBZ2 $compat_libdir $additional_compat_libdir; do - if test $have_fdpass = 0; then - if test "$cross_compiling" = yes; then : - have_fdpass=0 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -#define _XOPEN_SOURCE 500 -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include -#include -#include -#include -#include -#ifdef HAVE_SYS_UIO_H -#include -#endif -#include -#include - -#if !defined CMSG_SPACE || !defined CMSG_LEN -#ifndef ALIGN -#define ALIGN(len) len -#endif - -#ifndef CMSG_SPACE -#define CMSG_SPACE(len) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(len)) -#endif - -#ifndef CMSG_LEN -#define CMSG_LEN(len) (ALIGN(sizeof(struct cmsghdr)) + len) -#endif -#endif - -#define TEST "test" - -static int send_fd(int s, int fd) -{ - struct msghdr msg; - struct cmsghdr *cmsg; - unsigned char fdbuf[CMSG_SPACE(sizeof(int))]; - struct iovec iov[1]; - char dummy[] = ""; - - iov[0].iov_base = dummy; - iov[0].iov_len = 1; - - memset(&msg, 0, sizeof(msg)); - msg.msg_control = fdbuf; - /* must send/receive at least one byte */ - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_controllen = CMSG_LEN(sizeof(int)); + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - cmsg = CMSG_FIRSTHDR(&msg); + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBBZ2; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_so" + else + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$found_a" + else + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBBZ2_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/lib/"'*$,,'` + LIBBZ2_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCBZ2; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCBZ2="${INCBZ2}${INCBZ2:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBBZ2; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBBZ2; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$dep" + LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }$dep" + ;; + esac + done + fi + else + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }-l$name" + LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBBZ2="${LIBBZ2}${LIBBZ2:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBBZ2="${LTLIBBZ2}${LTLIBBZ2:+ }-R$found_dir" + done + fi + + ac_cv_libbz2_libs="$LIBBZ2" + ac_cv_libbz2_ltlibs="$LTLIBBZ2" + ac_cv_libbz2_cppflags="$INCBZ2" + ac_cv_libbz2_prefix="$LIBBZ2_PREFIX" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libbz2_libs" >&5 +$as_echo "$ac_cv_libbz2_libs" >&6; } + LIBBZ2="$ac_cv_libbz2_libs" + LTLIBBZ2="$ac_cv_libbz2_ltlibs" + INCBZ2="$ac_cv_libbz2_cppflags" + LIBBZ2_PREFIX="$ac_cv_libbz2_prefix" + + for element in $INCBZ2; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + + + HAVE_LIBBZ2=yes + + + + save_LDFLAGS="$LDFLAGS" + # Only add -L if prefix is not empty + test -z "$LIBBZ2_PREFIX" || LDFLAGS="$LDFLAGS -L$LIBBZ2_PREFIX/$acl_libdirstem"; + + have_bzprefix="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5 +$as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; } +if ${ac_cv_lib_bz2_BZ2_bzDecompressInit+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbz2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char BZ2_bzDecompressInit (); +int +main () +{ +return BZ2_bzDecompressInit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bz2_BZ2_bzDecompressInit=yes +else + ac_cv_lib_bz2_BZ2_bzDecompressInit=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5 +$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; } +if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then : + have_bzprefix="yes" +fi + + if test "x$have_bzprefix" = "xno"; then + +$as_echo "#define NOBZ2PREFIX 1" >>confdefs.h + + fi + LDFLAGS="$save_LDFLAGS" + if test "$HAVE_LIBBZ2" = "yes"; then + ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" +if test "x$ac_cv_header_bzlib_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CVE-2008-1372" >&5 +$as_echo_n "checking for CVE-2008-1372... " >&6; } +if ${ac_cv_c_cve_2008_1372+:} false; then : + $as_echo_n "(cached) " >&6 +else + +save_LIBS="$LIBS" +LIBS="$LIBCLAMAV_LIBS $LIBBZ2" +if test "$cross_compiling" = yes; then : + ac_cv_c_cve_2008_1372=ok +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include + +#ifdef NOBZ2PREFIX +#define BZ2_bzReadOpen bzReadOpen +#define BZ2_bzReadClose bzReadClose +#define BZ2_bzRead bzRead +#define BZ2_bzDecompressInit bzDecompressInit +#define BZ2_bzDecompress bzDecompress +#define BZ2_bzDecompressEnd bzDecompressEnd +#endif + +const unsigned char poc[] = { + 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x20, 0x0c, + 0xa6, 0x9c, 0x00, 0x00, 0xc2, 0xfb, 0x90, 0xca, 0x10, 0x04, 0x00, 0x40, + 0x03, 0x77, 0x80, 0x06, 0x00, 0x7a, 0x2f, 0xde, 0x40, 0x04, 0x00, 0x40, + 0x08, 0x30, 0x00, 0xb9, 0xb0, 0x4a, 0x89, 0xa3, 0x43, 0x4d, 0x00, 0x00, + 0x01, 0xb5, 0x04, 0xa4, 0x6a, 0x19, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, + 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, + 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, + 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x2a, + 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, + 0x91, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x91, 0x2a, 0xad, 0x2a, 0x91, 0x32, + 0x9a, 0x32, 0x0d, 0x06, 0x8d, 0x00, 0x03, 0xf7, 0x13, 0xd2, 0xf5, 0x54, + 0x5b, 0x20, 0x4b, 0x34, 0x40, 0x8a, 0x6b, 0xaa, 0x64, 0xd8, 0x30, 0x9d, + 0x8a, 0x9a, 0x52, 0x44, 0x13, 0x46, 0x37, 0xd9, 0x0a, 0x3c, 0xa6, 0xee, + 0xe9, 0xee, 0xec, 0x6d, 0x4a, 0x65, 0xc2, 0x32, 0xcb, 0x43, 0x82, 0x48, + 0xa1, 0x26, 0xc3, 0x43, 0x11, 0x47, 0x0a, 0x5e, 0xc1, 0x30, 0x55, 0x84, + 0xb1, 0x25, 0x7a, 0x2b, 0x86, 0x0e, 0xc8, 0x1a, 0x45, 0x10, 0xf1, 0xa9, + 0x19, 0x00, 0x30, 0x3c, 0x2a, 0xeb, 0x16, 0x6a, 0x75, 0x86, 0x60, 0xd0, + 0xc7, 0xd0, 0x94, 0x34, 0xf1, 0x6b, 0x49, 0x9f, 0x30, 0x4e, 0x0f, 0x70, + 0xbe, 0x12, 0x28, 0xe9, 0x7d, 0x10, 0x80, 0x35, 0x53, 0xaf, 0x72, 0xe1, + 0x83, 0x90, 0xb8, 0xf8, 0x4b, 0x1a, 0xa4, 0x29, 0x1b, 0x90, 0xe1, 0x4a, + 0x0f, 0xc5, 0xdc, 0x91, 0x4e, 0x14, 0x24, 0x08, 0x03, 0x29, 0xa7, 0x00 +}; +const unsigned int poc_len = 252; + +int main (int argc, char **argv) { + bz_stream bz; + char buf[1024]; + + memset(&bz, 0, sizeof(bz)); + bz.next_in = (char *)&poc; + bz.avail_in = poc_len; + bz.next_out = buf; + bz.avail_out = sizeof(buf); + if(BZ2_bzDecompressInit(&bz, 0, 0)!=BZ_OK) + return 1; + + while((BZ2_bzDecompress(&bz))==BZ_OK) { + bz.next_out = buf; + bz.avail_out = sizeof(buf); + } + BZ2_bzDecompressEnd(&bz); + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_cve_2008_1372=ok +else + +if test $? -gt 127; then + ac_cv_c_cve_2008_1372=bugged +else + ac_cv_c_cve_2008_1372=linkfailed +fi + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_cve_2008_1372" >&5 +$as_echo "$ac_cv_c_cve_2008_1372" >&6; } + +else + ac_cv_c_cve_2008_1372="no" +fi + + + if test "$ac_cv_c_cve_2008_1372" = "bugged"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 libraries are affected by the CVE-2008-1372 bug" >&5 +$as_echo "$as_me: WARNING: ****** bzip2 libraries are affected by the CVE-2008-1372 bug" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** We strongly suggest you to update to bzip2 1.0.5." >&5 +$as_echo "$as_me: WARNING: ****** We strongly suggest you to update to bzip2 1.0.5." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 +$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} + bzip_check="bugged (CVE-2008-1372)" + fi + if test "$ac_cv_c_cve_2008_1372" = "linkfailed"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Unable to link bzip2 testcase" >&5 +$as_echo "$as_me: WARNING: ****** Unable to link bzip2 testcase" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** You may be affected by CVE-2008-1372 bug, but I need to be able to link a testcase to verify" >&5 +$as_echo "$as_me: WARNING: ****** You may be affected by CVE-2008-1372 bug, but I need to be able to link a testcase to verify" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&5 +$as_echo "$as_me: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 +$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} + bzip_check="link failed (CVE-2008-1372)" + fi + + case "$ac_cv_c_cve_2008_1372" in + ok|bugged|linkfailed) + ;; + *) + HAVE_LIBBZ2=no + ;; + esac + fi + + if test "$HAVE_LIBBZ2" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CVE-2010-0405" >&5 +$as_echo_n "checking for CVE-2010-0405... " >&6; } +if ${ac_cv_c_cve_2010_0405+:} false; then : + $as_echo_n "(cached) " >&6 +else + +save_LIBS="$LIBS" +LIBS="$LIBCLAMAV_LIBS $LIBBZ2" +if test "$cross_compiling" = yes; then : + ac_cv_c_cve_2010_0405=ok +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef NOBZ2PREFIX +#define BZ2_bzReadOpen bzReadOpen +#define BZ2_bzReadClose bzReadClose +#define BZ2_bzRead bzRead +#define BZ2_bzDecompressInit bzDecompressInit +#define BZ2_bzDecompress bzDecompress +#define BZ2_bzDecompressEnd bzDecompressEnd +#endif + +const unsigned char poc[] = { +0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, +0xff, 0xff, 0xfe, 0x20, 0x2c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, +0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, +0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xff +}; +const unsigned int poc_len = 280; + +int main (int argc, char **argv) { + bz_stream bz; + char buf[1024]; + + memset(&bz, 0, sizeof(bz)); + bz.next_in = (char *)&poc; + bz.avail_in = poc_len; + bz.next_out = buf; + bz.avail_out = sizeof(buf); + + alarm(10); + + if(BZ2_bzDecompressInit(&bz, 0, 0)!=BZ_OK) + return 1; + + while((BZ2_bzDecompress(&bz))==BZ_OK) { + bz.next_out = buf; + bz.avail_out = sizeof(buf); + } + BZ2_bzDecompressEnd(&bz); + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_cve_2010_0405=ok +else + +if test $? -gt 127; then + ac_cv_c_cve_2010_0405=bugged +else + ac_cv_c_cve_2010_0405=linkfailed +fi + +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_cve_2010_0405" >&5 +$as_echo "$ac_cv_c_cve_2010_0405" >&6; } + + if test "$ac_cv_c_cve_2010_0405" = "bugged"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 libraries are affected by the CVE-2010-0405 bug" >&5 +$as_echo "$as_me: WARNING: ****** bzip2 libraries are affected by the CVE-2010-0405 bug" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** We strongly suggest you to update bzip2" >&5 +$as_echo "$as_me: WARNING: ****** We strongly suggest you to update bzip2" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 +$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} + bzip_check="bugged (CVE-2010-0405)" + fi + if test "$ac_cv_c_cve_2010_0405" = "linkfailed"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Unable to link bzip2 testcase" >&5 +$as_echo "$as_me: WARNING: ****** Unable to link bzip2 testcase" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** You may be affected by CVE-2010-0405 bug, but I need to be able to link a testcase to verify" >&5 +$as_echo "$as_me: WARNING: ****** You may be affected by CVE-2010-0405 bug, but I need to be able to link a testcase to verify" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&5 +$as_echo "$as_me: WARNING: ****** It is recommended to fix your build environment so that we can run the testcase!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&5 +$as_echo "$as_me: WARNING: ****** Please do not report stability problems to the ClamAV developers!" >&2;} + bzip_check="link failed (CVE-2010-0405)" + fi + + case "$ac_cv_c_cve_2010_0405" in + ok|bugged|linkfailed) + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS $LTLIBBZ2" + +$as_echo "#define HAVE_BZLIB_H 1" >>confdefs.h + + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 support disabled" >&5 +$as_echo "$as_me: WARNING: ****** bzip2 support disabled" >&2;} + ;; + esac + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** bzip2 support disabled" >&5 +$as_echo "$as_me: WARNING: ****** bzip2 support disabled" >&2;} + fi +fi + + if test "x$HAVE_LIBBZ2" = "xyes"; then + HAVE_LIBBZ2_TRUE= + HAVE_LIBBZ2_FALSE='#' +else + HAVE_LIBBZ2_TRUE='#' + HAVE_LIBBZ2_FALSE= +fi + + +# Check whether --enable-unrar was given. +if test "${enable_unrar+set}" = set; then : + enableval=$enable_unrar; want_unrar=$enableval +else + want_unrar="yes" +fi + + if test "$want_unrar" = "yes"; then + ENABLE_UNRAR_TRUE= + ENABLE_UNRAR_FALSE='#' +else + ENABLE_UNRAR_TRUE='#' + ENABLE_UNRAR_FALSE= +fi + + +# Check whether --enable-getaddrinfo was given. +if test "${enable_getaddrinfo+set}" = set; then : + enableval=$enable_getaddrinfo; want_getaddrinfo=$enableval +else + want_getaddrinfo="yes" +fi + + +if test "$want_getaddrinfo" = "yes" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } + if ${have_cv_gai+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + have_cv_gai=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + int main(int argc, char **argv) + { + struct addrinfo *res; + int sd; + + if(getaddrinfo("127.0.0.1", NULL, NULL, &res) < 0) + return 1; + freeaddrinfo(res); + + return 0; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_cv_gai=yes +else + have_cv_gai=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_gai" >&5 +$as_echo "$have_cv_gai" >&6; } + if test "$have_cv_gai" = yes; then + +$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h + + fi +fi + +# Check whether --enable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then : + enableval=$enable_ipv6; want_ipv6=$enableval +else + want_ipv6="yes" +fi + + +if test "$want_ipv6" = "yes" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 support" >&5 +$as_echo_n "checking for IPv6 support... " >&6; } + if ${have_cv_ipv6+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + have_cv_ipv6=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + int main(int argc, char **argv) + { + struct addrinfo *res, hints; + int sd; + + if((sd = socket(AF_INET6, SOCK_STREAM, 0)) < 0) + return 1; + close(sd); + /* also check if getaddrinfo() handles AF_UNSPEC -- bb#1196 */ + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + if(getaddrinfo("127.0.0.1", NULL, &hints, &res) < 0) + return 1; + freeaddrinfo(res); + return 0; + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_cv_ipv6=yes +else + have_cv_ipv6=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_ipv6" >&5 +$as_echo "$have_cv_ipv6" >&6; } + if test "$have_cv_ipv6" = yes; then + +$as_echo "#define SUPPORT_IPv6 1" >>confdefs.h + + fi +fi + + + +# Check whether --enable-dns was given. +if test "${enable_dns+set}" = set; then : + enableval=$enable_dns; want_dns=$enableval +else + want_dns=yes + +fi + +if test $want_dns = yes; then + ac_cv_have_lresolv=no + ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" " +#include +#include +#include + +" +if test "x$ac_cv_header_resolv_h" = xyes; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_expand in std libs" >&5 +$as_echo_n "checking for dn_expand in std libs... " >&6; } +if ${ac_cv_have_lresolv_std+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_cv_have_lresolv_std='no' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +int main() { return (long)dn_expand; } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + ac_cv_have_lresolv_std='yes' + ac_cv_have_lresolv='' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lresolv_std" >&5 +$as_echo "$ac_cv_have_lresolv_std" >&6; } + if test "x$ac_cv_have_lresolv" = "xno"; then + bklibs=$LIBS + LIBS=-lresolv + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dn_expand in -lresolv" >&5 +$as_echo_n "checking for dn_expand in -lresolv... " >&6; } +if ${ac_cv_have_lresolv_lresolv+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_cv_have_lresolv_lresolv='yes' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +int main() { return (long)dn_expand; } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + ac_cv_have_lresolv_lresolv='yes' + ac_cv_have_lresolv=' -lresolv' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lresolv_lresolv" >&5 +$as_echo "$ac_cv_have_lresolv_lresolv" >&6; } + LIBS=$bklibs; + fi + +else + ac_cv_have_lresolv=no +fi + + + if test "x$ac_cv_have_lresolv" != "xno"; then + FRESHCLAM_LIBS="$FRESHCLAM_LIBS$ac_cv_have_lresolv" + +$as_echo "#define HAVE_RESOLV_H 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** DNS support disabled" >&5 +$as_echo "$as_me: WARNING: ****** DNS support disabled" >&2;} + fi +fi + + + +# Check whether --enable-fanotify was given. +if test "${enable_fanotify+set}" = set; then : + enableval=$enable_fanotify; want_fanotify=$enableval +else + want_fanotify="yes" +fi + + +if test "$cross_compiling" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 +$as_echo_n "checking whether setpgrp takes no argument... " >&6; } +if ${ac_cv_func_setpgrp_void+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +/* If this system has a BSD-style setpgrp which takes arguments, + setpgrp(1, 1) will fail with ESRCH and return -1, in that case + exit successfully. */ + return setpgrp (1,1) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_setpgrp_void=no +else + ac_cv_func_setpgrp_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 +$as_echo "$ac_cv_func_setpgrp_void" >&6; } +if test $ac_cv_func_setpgrp_void = yes; then + +$as_echo "#define SETPGRP_VOID 1" >>confdefs.h + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 +$as_echo_n "checking whether setpgrp takes no argument... " >&6; } +if ${ac_cv_func_setpgrp_void+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main () +{ + + if (setpgrp(1,1) == -1) + exit (0); + else + exit (1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_func_setpgrp_void=no +else + ac_cv_func_setpgrp_void=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 +$as_echo "$ac_cv_func_setpgrp_void" >&6; } +if test $ac_cv_func_setpgrp_void = yes; then + $as_echo "#define SETPGRP_VOID 1" >>confdefs.h + +fi +fi + +# Check whether --enable-milter was given. +if test "${enable_milter+set}" = set; then : + enableval=$enable_milter; have_milter=$enableval +else + have_milter="no" +fi + + + +# Check whether --with-iconv was given. +if test "${with_iconv+set}" = set; then : + withval=$with_iconv; + case "$withval" in + yes|no) wiconv="$withval";; + *) as_fn_error $? "--with-iconv does not take an argument" "$LINENO" 5;; + esac +else + wiconv=auto +fi + +if test "X$wiconv" != "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 +$as_echo_n "checking for libiconv_open in -liconv... " >&6; } +if ${ac_cv_lib_iconv_libiconv_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-liconv $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char libiconv_open (); +int +main () +{ +return libiconv_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_iconv_libiconv_open=yes +else + ac_cv_lib_iconv_libiconv_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 +$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } +if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then : + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -liconv" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } + save_LIBS="$LIBS" + LIBS="$LIBCLAMAV_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + char** xin,**xout; + unsigned long il,ol; + int rc; + iconv_t iconv_struct = iconv_open("UTF-16BE","UTF-8"); + rc = iconv(iconv_struct,xin,&il,xout,&ol); + iconv_close(iconv_struct); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" +fi + +# Check whether --enable-pthreads was given. +if test "${enable_pthreads+set}" = set; then : + enableval=$enable_pthreads; have_pthreads=$enableval +fi + + +# Check whether --enable-cr was given. +if test "${enable_cr+set}" = set; then : + enableval=$enable_cr; use_cr=$enableval +fi + + +# Check whether --enable-id-check was given. +if test "${enable_id_check+set}" = set; then : + enableval=$enable_id_check; use_id=$enableval +else + use_id="no" +fi + + +# Check whether --enable-yp-check was given. +if test "${enable_yp_check+set}" = set; then : + enableval=$enable_yp_check; use_yp=$enableval +else + use_yp="no" +fi + + +# Check whether --enable-yp-check was given. +if test "${enable_yp_check+set}" = set; then : + enableval=$enable_yp_check; use_yp=$enableval +else + use_yp="no" +fi + + + +# Check whether --with-user was given. +if test "${with_user+set}" = set; then : + withval=$with_user; clamav_user="$withval" +else + clamav_user="clamav" +fi + + + +# Check whether --with-group was given. +if test "${with_group+set}" = set; then : + withval=$with_group; clamav_group="$withval" +else + clamav_group="clamav" +fi + + + +cat >>confdefs.h <<_ACEOF +#define CLAMAVUSER "$clamav_user" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define CLAMAVGROUP "$clamav_group" +_ACEOF + + +if test "$enable_debug" = "yes"; then + VERSION_SUFFIX="$VERSION_SUFFIX-debug" + +$as_echo "#define CL_DEBUG 1" >>confdefs.h + +else + +$as_echo "#define NDEBUG 1" >>confdefs.h + +fi + + +# Check whether --with-version was given. +if test "${with_version+set}" = set; then : + withval=$with_version; VERSION="$withval" +fi + + +# Check whether --enable-no-cache was given. +if test "${enable_no_cache+set}" = set; then : + enableval=$enable_no_cache; enable_nocache=$enableval +else + enable_nocache="no" +fi + + +if test "$enable_nocache" = "yes"; then + +$as_echo "#define FRESHCLAM_NO_CACHE 1" >>confdefs.h + +fi + + +# Check whether --enable-dns-fix was given. +if test "${enable_dns_fix+set}" = set; then : + enableval=$enable_dns_fix; enable_dnsfix=$enableval +else + enable_dnsfix="no" +fi + + +if test "$enable_dnsfix" = "yes"; then + +$as_echo "#define FRESHCLAM_DNS_FIX 1" >>confdefs.h + +fi + +# Check whether --enable-bigstack was given. +if test "${enable_bigstack+set}" = set; then : + enableval=$enable_bigstack; enable_bigstack=$enableval +else + enable_bigstack="no" +fi + + +if test "$enable_bigstack" = "yes"; then + +$as_echo "#define C_BIGSTACK 1" >>confdefs.h + +fi + + +# Check whether --with-dbdir was given. +if test "${with_dbdir+set}" = set; then : + withval=$with_dbdir; db_dir="$withval" +else + db_dir="_default_" +fi + + +if test "$db_dir" = "_default_" +then + if test "$prefix" = "NONE" + then + db_dir="$ac_default_prefix/share/clamav" + else + db_dir="$prefix/share/clamav" + fi +fi + + +cat >>confdefs.h <<_ACEOF +#define DATADIR "$db_dir" +_ACEOF + +DBDIR="$db_dir" + + +cfg_dir=`echo $sysconfdir | grep prefix` + +if test -n "$cfg_dir"; then + if test "$prefix" = "NONE" + then + cfg_dir="$ac_default_prefix/etc" + else + cfg_dir="$prefix/etc" + fi +else + cfg_dir="$sysconfdir" +fi + +CFGDIR=$cfg_dir + + +cat >>confdefs.h <<_ACEOF +#define CONFDIR "$cfg_dir" +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether in_port_t is defined" >&5 +$as_echo_n "checking whether in_port_t is defined... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ +in_port_t pt; pt = 0; return pt; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_IN_PORT_T 1" >>confdefs.h + + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in_addr_t definition" >&5 +$as_echo_n "checking for in_addr_t definition... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + in_addr_t pt; pt = 0; return pt; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_IN_ADDR_T 1" >>confdefs.h + + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +case "$target_os" in +linux*) + +$as_echo "#define C_LINUX 1" >>confdefs.h + + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + if test "$want_fanotify" = "yes"; then + ac_fn_c_check_header_mongrel "$LINENO" "linux/fanotify.h" "ac_cv_header_linux_fanotify_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_fanotify_h" = xyes; then : + +$as_echo "#define FANOTIFY 1" >>confdefs.h + +fi + + + fi + fi + ;; +kfreebsd*-gnu) + +$as_echo "#define C_KFREEBSD_GNU 1" >>confdefs.h + + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + ;; +solaris*) + CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lresolv" + FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv" + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + CLAMD_LIBS="$CLAMD_LIBS -lresolv" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lresolv" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_SOLARIS 1" >>confdefs.h + + ;; +freebsd[45]*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread -lc_r" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_BSD 1" >>confdefs.h + + ;; +freebsd*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lthr" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_BSD 1" >>confdefs.h + + ;; +dragonfly*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_BSD 1" >>confdefs.h + + ;; +openbsd*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + CLAMD_LIBS="$CLAMD_LIBS -pthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_BSD 1" >>confdefs.h + + ;; +bsdi*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_BSD 1" >>confdefs.h + + ;; +netbsd*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + fi + +$as_echo "#define C_BSD 1" >>confdefs.h + + ;; +bsd*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown BSD detected. Disabling thread support." >&5 +$as_echo "Unknown BSD detected. Disabling thread support." >&6; } + have_pthreads="no" + +$as_echo "#define C_BSD 1" >>confdefs.h + + ;; +beos*) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: BeOS detected. Disabling thread support." >&5 +$as_echo "BeOS detected. Disabling thread support." >&6; } + have_pthreads="no" + +$as_echo "#define C_BEOS 1" >>confdefs.h + + ;; +x86:Interix*) + +$as_echo "#define C_INTERIX 1" >>confdefs.h + + ;; +darwin*) + +$as_echo "#define C_BSD 1" >>confdefs.h + + +$as_echo "#define C_DARWIN 1" >>confdefs.h + + +$as_echo "#define BIND_8_COMPAT 1" >>confdefs.h + + +$as_echo "#define CLAMAUTH 1" >>confdefs.h + + use_netinfo="yes" + ;; +os2*) + CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lsyslog" + FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsyslog" + CLAMD_LIBS="$CLAMD_LIBS -lsyslog" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsyslog" + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_OS2 1" >>confdefs.h + + ;; +sco*) + ;; +hpux*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + +$as_echo "#define C_HPUX 1" >>confdefs.h + + if test "$have_mempool" = "yes"; then + LDFLAGS="$LDFLAGS -Wl,+pd,1M" + fi + ;; +aix*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + +$as_echo "#define _THREAD_SAFE 1" >>confdefs.h + + fi + +$as_echo "#define C_AIX 1" >>confdefs.h + + ;; +*-*-osf*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + TH_SAFE="-thread-safe" + +$as_echo "#define _POSIX_PII_SOCKET 1" >>confdefs.h + + fi + +$as_echo "#define C_OSF 1" >>confdefs.h + + ;; +nto-qnx*) + +$as_echo "#define C_QNX6 1" >>confdefs.h + + ;; +irix*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + LIBS="$LIBS -lgen" + +$as_echo "#define C_IRIX 1" >>confdefs.h + + ;; +interix*) + +$as_echo "#define C_INTERIX 1" >>confdefs.h + + if test "$test_clamav" = "yes"; then + if test ! -r /etc/passwd; then + test_clamav="no" + fi + fi + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + ;; +gnu*) + +$as_echo "#define C_GNU_HURD 1" >>confdefs.h + + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + ;; +*) + ;; +esac + +if test "$have_milter" = "yes"; then + + save_LIBS="$LIBS" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" + if test -d /usr/lib/libmilter ; then + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter" + fi + LIBS="$LIBS -lmilter $CLAMAV_MILTER_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mi_stop in -lmilter" >&5 +$as_echo_n "checking for mi_stop in -lmilter... " >&6; } +if ${ac_cv_lib_milter_mi_stop+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmilter $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mi_stop (); +int +main () +{ +return mi_stop (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_milter_mi_stop=yes +else + ac_cv_lib_milter_mi_stop=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_milter_mi_stop" >&5 +$as_echo "$ac_cv_lib_milter_mi_stop" >&6; } +if test "x$ac_cv_lib_milter_mi_stop" = xyes; then : + CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_LIBS" +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strlcpy" >&5 +$as_echo_n "checking for library containing strlcpy... " >&6; } +if ${ac_cv_search_strlcpy+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strlcpy (); +int +main () +{ +return strlcpy (); + ; + return 0; +} +_ACEOF +for ac_lib in '' sm smutil; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_strlcpy=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_strlcpy+:} false; then : + break +fi +done +if ${ac_cv_search_strlcpy+:} false; then : + +else + ac_cv_search_strlcpy=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strlcpy" >&5 +$as_echo "$ac_cv_search_strlcpy" >&6; } +ac_res=$ac_cv_search_strlcpy +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + test "$ac_cv_search_strlcpy" = "none required" || CLAMAV_MILTER_XLIB="$ac_cv_search_strlcpy" +fi + + LIBS="$save_LIBS $CLAMAV_MILTER_LIBS $CLAMAV_MILTER_XLIB" + $as_unset ac_cv_lib_milter_mi_stop + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mi_stop in -lmilter" >&5 +$as_echo_n "checking for mi_stop in -lmilter... " >&6; } +if ${ac_cv_lib_milter_mi_stop+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmilter $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mi_stop (); +int +main () +{ +return mi_stop (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_milter_mi_stop=yes +else + ac_cv_lib_milter_mi_stop=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_milter_mi_stop" >&5 +$as_echo "$ac_cv_lib_milter_mi_stop" >&6; } +if test "x$ac_cv_lib_milter_mi_stop" = xyes; then : + CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_XLIB $CLAMAV_MILTER_LIBS" +else + + as_fn_error $? "Cannot find libmilter" "$LINENO" 5 + +fi + + +fi + + LIBS="$save_LIBS" + for ac_header in libmilter/mfapi.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libmilter/mfapi.h" "ac_cv_header_libmilter_mfapi_h" "$ac_includes_default" +if test "x$ac_cv_header_libmilter_mfapi_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBMILTER_MFAPI_H 1 +_ACEOF + have_milter="yes" +else + + as_fn_error $? "Please install mfapi.h from the sendmail distribution" "$LINENO" 5 + +fi + +done + +fi + + if test "$have_pthreads" = "yes"; then + BUILD_CLAMD_TRUE= + BUILD_CLAMD_FALSE='#' +else + BUILD_CLAMD_TRUE='#' + BUILD_CLAMD_FALSE= +fi + + if test "$have_milter" = "yes"; then + HAVE_MILTER_TRUE= + HAVE_MILTER_FALSE='#' +else + HAVE_MILTER_TRUE='#' + HAVE_MILTER_FALSE= +fi + + +if test "$have_pthreads" = "yes" +then + save_LIBS="$LIBS" + LIBS="$THREAD_LIBS $LIBS" + for ac_func in sched_yield pthread_yield +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + LIBS="$save_LIBS" + +$as_echo "#define BUILD_CLAMD 1" >>confdefs.h + + +$as_echo "#define CL_THREAD_SAFE 1" >>confdefs.h + + +$as_echo "#define _REENTRANT 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for readdir_r" >&5 +$as_echo_n "checking for readdir_r... " >&6; } +if test -z "$ac_cv_readdir_args"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + + struct dirent dir, *dirp; + DIR *mydir; + dirp = readdir_r(mydir, &dir); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_readdir_args=2 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +if test -z "$ac_cv_readdir_args"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ + + struct dirent dir, *dirp; + DIR *mydir; + int rc; + rc = readdir_r(mydir, &dir, &dirp); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_readdir_args=3 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +# Check whether --enable-readdir_r was given. +if test "${enable_readdir_r+set}" = set; then : + enableval=$enable_readdir_r; enable_readdir_r=$enableval +else + enable_readdir_r="no" +fi + + +if test "$enable_readdir_r" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: support disabled" >&5 +$as_echo "support disabled" >&6; } +elif test -z "$ac_cv_readdir_args"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + if test "$ac_cv_readdir_args" = 2; then + +$as_echo "#define HAVE_READDIR_R_2 1" >>confdefs.h + + elif test "$ac_cv_readdir_args" = 3; then + +$as_echo "#define HAVE_READDIR_R_3 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes $ac_cv_readdir_args arguments" >&5 +$as_echo "yes, and it takes $ac_cv_readdir_args arguments" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctime_r" >&5 +$as_echo_n "checking for ctime_r... " >&6; } +if test "$ac_cv_func_ctime_r" = "yes"; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + +int +main () +{ + + char buf[31]; + time_t t; + ctime_r(&t, buf, 30); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + ac_cv_ctime_args=3 + +$as_echo "#define HAVE_CTIME_R_3 1" >>confdefs.h + + +else + + ac_cv_ctime_args=2 + +$as_echo "#define HAVE_CTIME_R_2 1" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes $ac_cv_ctime_args arguments" >&5 +$as_echo "yes, and it takes $ac_cv_ctime_args arguments" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } +if ${ac_cv_socklen_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_cv_socklen_t=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + socklen_t len; + getpeername(0,0,&len); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + ac_cv_socklen_t=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_socklen_t" >&5 +$as_echo "$ac_cv_socklen_t" >&6; } + if test $ac_cv_socklen_t = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5 +$as_echo_n "checking for socklen_t equivalent... " >&6; } + if ${ac_cv_socklen_t_equiv+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ac_cv_socklen_t_equiv=int + for t in int size_t unsigned long "unsigned long"; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + +int +main () +{ + + $t len; + getpeername(0,0,&len); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + ac_cv_socklen_t_equiv="$t" + break + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_socklen_t_equiv" >&5 +$as_echo "$ac_cv_socklen_t_equiv" >&6; } + +cat >>confdefs.h <<_ACEOF +#define socklen_t $ac_cv_socklen_t_equiv +_ACEOF + +fi + +if test "$test_clamav" = "yes" +then + if test "$use_id" = "no" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user in /etc/passwd" >&5 +$as_echo_n "checking for $clamav_user in /etc/passwd... " >&6; } + if test -r /etc/passwd; then + clamavuser=`cat /etc/passwd|grep "^$clamav_user:"` + clamavgroup=`cat /etc/group|grep "^$clamav_group:"` + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using id" >&5 +$as_echo_n "checking for $clamav_user using id... " >&6; } + id $clamav_user > /dev/null 2>&1 + if test "$?" = 0 ; then + clamavuser=1 + # Extract the first word of "getent", so it can be a program name with args. +set dummy getent; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GETENT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GETENT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GETENT="$GETENT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GETENT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GETENT=$ac_cv_path_GETENT +if test -n "$GETENT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GETENT" >&5 +$as_echo "$GETENT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test -n "$GETENT" ; then + clamavgroup=`$GETENT group | grep "^${clamav_group}:"` + else + clamavgroup=`cat /etc/group|grep $clamav_group` + fi + fi + fi + + if test "$use_netinfo" = "yes" + then + if test -x /usr/bin/dscl; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using dscl" >&5 +$as_echo_n "checking for $clamav_user using dscl... " >&6; } + clamavuser=`/usr/bin/dscl . -list /Users |grep ${clamav_user}` + clamavgroup=`/usr/bin/dscl . -list /Groups |grep ${clamav_group}` + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using netinfo" >&5 +$as_echo_n "checking for $clamav_user using netinfo... " >&6; } + clamavuser=`/usr/bin/nidump passwd . |grep ${clamav_user}` + clamavgroup=`/usr/bin/nidump group . |grep ${clamav_group}` + fi + fi + + if test "$use_yp" = "yes" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $clamav_user using ypmatch" >&5 +$as_echo_n "checking for $clamav_user using ypmatch... " >&6; } + clamavuser=`ypmatch ${clamav_user} passwd` + clamavgroup=`ypmatch ${clamav_group} group` + fi + + if test -z "$clamavuser" || test -z "$clamavgroup" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "User $clamav_user (and/or group $clamav_group) doesn't exist. Please read the documentation !" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, user $clamav_user and group $clamav_group" >&5 +$as_echo "yes, user $clamav_user and group $clamav_group" >&6; } + CLAMAVUSER="$clamav_user" + CLAMAVGROUP="$clamav_group" + + + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for structure packing via __attribute__((packed))" >&5 +$as_echo_n "checking for structure packing via __attribute__((packed))... " >&6; } +if ${have_cv_attrib_packed+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifdef __GNUC__ + struct { int i __attribute__((packed)); } s; + #else + #error Only checking for packed attribute on gcc-like compilers + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_cv_attrib_packed=yes +else + have_cv_attrib_packed=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_attrib_packed" >&5 +$as_echo "$have_cv_attrib_packed" >&6; } + +if test "$have_cv_attrib_packed" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for structure packing via pragma" >&5 +$as_echo_n "checking for structure packing via pragma... " >&6; } + if ${have_cv_pragma_pack+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int main(int argc, char **argv) { +#pragma pack(1) /* has to be in column 1 ! */ + struct { char c; long l; } s; + return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_cv_pragma_pack=yes +else + have_cv_pragma_pack=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_pragma_pack" >&5 +$as_echo "$have_cv_pragma_pack" >&6; } + if test "$have_cv_pragma_pack" = yes; then + +$as_echo "#define HAVE_PRAGMA_PACK 1" >>confdefs.h + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for structure packing via hppa/hp-ux pragma" >&5 +$as_echo_n "checking for structure packing via hppa/hp-ux pragma... " >&6; } + if ${have_cv_pragma_pack_hpux+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* hppa/hp-ux wants pragma outside of function */ +#pragma pack 1 /* has to be in column 1 ! */ + struct { char c; long l; } s; + int main(int argc, char **argv) { + return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_cv_pragma_pack_hpux=yes +else + have_cv_pragma_pack_hpux=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_pragma_pack_hpux" >&5 +$as_echo "$have_cv_pragma_pack_hpux" >&6; } + +$as_echo "#define HAVE_PRAGMA_PACK_HPPA 1" >>confdefs.h + + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type aligning via __attribute__((aligned))" >&5 +$as_echo_n "checking for type aligning via __attribute__((aligned))... " >&6; } +if ${have_cv_attrib_aligned+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +typedef int cl_aligned_int __attribute__((aligned)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_cv_attrib_aligned=yes +else + have_cv_attrib_aligned=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_attrib_aligned" >&5 +$as_echo "$have_cv_attrib_aligned" >&6; } + +if test "$have_cv_attrib_packed" = no -a "$have_cv_pragma_pack" = no -a "$have_cv_pragma_pack_hpux" = no; then + as_fn_error $? "Need to know how to pack structures with this compiler" "$LINENO" 5 +fi + +if test "$have_cv_attrib_packed" = yes; then + +$as_echo "#define HAVE_ATTRIB_PACKED 1" >>confdefs.h + +fi + +if test "$have_cv_attrib_aligned" = yes; then + +$as_echo "#define HAVE_ATTRIB_ALIGNED 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that structure packing works" >&5 +$as_echo_n "checking that structure packing works... " >&6; } +if ${have_cv_struct_pack+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + have_cv_struct_pack=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef HAVE_ATTRIB_PACKED +#define __attribute__(x) +#endif +#ifdef HAVE_PRAGMA_PACK +#pragma pack(1) /* has to be in column 1 ! */ +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack 1 /* has to be in column 1 ! */ +#endif + +struct { char c __attribute__((packed)); long l __attribute__((packed)); } s; + +#ifdef HAVE_PRAGMA_PACK +#pragma pack() +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack +#endif + +struct { char c; long l;} s2; + +#ifdef HAVE_PRAGMA_PACK +#pragma pack(1) /* has to be in column 1 ! */ +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack 1 /* has to be in column 1 ! */ +#endif + +struct { char c; long l; } __attribute__((packed)) s3; + +#ifdef HAVE_PRAGMA_PACK +#pragma pack() +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack +#endif + + int main(int argc, char **argv) { + if (sizeof(s)!=sizeof(s.c)+sizeof(s.l)) + return 1; + if (sizeof(s) != sizeof(s3)) + return 2; + return (sizeof(s2) >= sizeof(s)) ? 0 : 3; + } +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_cv_struct_pack=yes +else + have_cv_struct_pack=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cv_struct_pack" >&5 +$as_echo "$have_cv_struct_pack" >&6; } + +if test "$have_cv_struct_pack" = "no"; then + as_fn_error $? "Structure packing seems to be available, but is not working with this compiler" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_set" >&5 +$as_echo_n "checking for fd_set... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "fd_mask" >/dev/null 2>&1; then : + have_fd_set=yes +fi +rm -f conftest* + +if test "$have_fd_set" = yes; then + +$as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in sys/select.h" >&5 +$as_echo "yes, found in sys/select.h" >&6; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #ifdef HAVE_UNISTD_H + #include + #endif +int +main () +{ +fd_set readMask, writeMask; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + have_fd_set=yes +else + have_fd_set=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test "$have_fd_set" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in sys/types.h" >&5 +$as_echo "yes, found in sys/types.h" >&6; } + else + +$as_echo "#define NO_FD_SET 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking default FD_SETSIZE value" >&5 +$as_echo_n "checking default FD_SETSIZE value... " >&6; } +if test "$cross_compiling" = yes; then : + DEFAULT_FD_SETSIZE=256 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include +int main(void) { + FILE *fp = fopen("conftestval", "w"); + if(fp) { + if(fprintf (fp, "%d\n", FD_SETSIZE) < 1) { + perror("fprintf failed"); + return errno; + } + } else { + perror("fopen failed"); + return errno; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + DEFAULT_FD_SETSIZE=`cat conftestval` +else + DEFAULT_FD_SETSIZE=256 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_FD_SETSIZE" >&5 +$as_echo "$DEFAULT_FD_SETSIZE" >&6; } + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_FD_SETSIZE $DEFAULT_FD_SETSIZE +_ACEOF + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stat64" >&5 +$as_echo_n "checking stat64... " >&6; } +if test "$cross_compiling" = yes; then : + enable_stat64=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#include +#include +#include +#include +#include + +int main(void) { + struct stat64 sb; + + if (stat64(".", &sb) == -1) + return errno; + + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + enable_stat64=yes +else + enable_stat64=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +if test "$enable_stat64" != "no"; then + +$as_echo "#define HAVE_STAT64 1" >>confdefs.h + +CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_stat64" >&5 +$as_echo "$enable_stat64" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signed right shift is sign extended" >&5 +$as_echo_n "checking whether signed right shift is sign extended... " >&6; } +if test "$cross_compiling" = yes; then : + have_signed_rightshift_extended=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){int a=-1;int b=a>>1;return(a!=b);} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_signed_rightshift_extended=yes +else + have_signed_rightshift_extended=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +if test $have_signed_rightshift_extended = yes; then + +$as_echo "#define HAVE_SAR 1" >>confdefs.h + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_signed_rightshift_extended" >&5 +$as_echo "$have_signed_rightshift_extended" >&6; }; + + +for ac_func in recvmsg sendmsg +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for msg_control field in struct msghdr" >&5 +$as_echo_n "checking for msg_control field in struct msghdr... " >&6; } +if ${ac_cv_have_control_in_msghdr+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE 500 +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include +#ifdef HAVE_SYS_UIO_H +#include +#endif + +int +main () +{ + +#ifdef msg_control +#error msg_control defined +#endif +struct msghdr m; +m.msg_control = 0; +return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_have_control_in_msghdr="yes" +else + ac_cv_have_control_in_msghdr="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_control_in_msghdr" >&5 +$as_echo "$ac_cv_have_control_in_msghdr" >&6; } +if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking BSD 4.4 / RFC2292 style fd passing" >&5 +$as_echo_n "checking BSD 4.4 / RFC2292 style fd passing... " >&6; } + # Check whether --enable-fdpassing was given. +if test "${enable_fdpassing+set}" = set; then : + enableval=$enable_fdpassing; want_fdpassing=$enableval +else + want_fdpassing="yes" +fi + + + if test "x$want_fdpassing" = "xyes"; then + if test "$cross_compiling" = yes; then : + have_fdpass=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_UIO_H +#include +#endif +#include +#include + +#if !defined CMSG_SPACE || !defined CMSG_LEN +#ifndef ALIGN +#define ALIGN(len) len +#endif + +#ifndef CMSG_SPACE +#define CMSG_SPACE(len) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(len)) +#endif + +#ifndef CMSG_LEN +#define CMSG_LEN(len) (ALIGN(sizeof(struct cmsghdr)) + len) +#endif +#endif + +#define TEST "test" + +static int send_fd(int s, int fd) +{ + struct msghdr msg; + struct cmsghdr *cmsg; + unsigned char fdbuf[CMSG_SPACE(sizeof(int))]; + struct iovec iov[1]; + char dummy[] = ""; + + iov[0].iov_base = dummy; + iov[0].iov_len = 1; + + memset(&msg, 0, sizeof(msg)); + msg.msg_control = fdbuf; + /* must send/receive at least one byte */ + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_controllen = CMSG_LEN(sizeof(int)); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_len = CMSG_LEN(sizeof(int)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SCM_RIGHTS; + *(int *)CMSG_DATA(cmsg) = fd; + + if (sendmsg(s, &msg, 0) == -1) { + perror("sendmsg"); + close(s); + return -1; + } + return 0; +} + +static int testfd(int desc) +{ + char buf[256]; + if(read(desc, buf, sizeof(buf)) != sizeof(TEST)) { + fprintf(stderr, "test data not received correctly!"); + return 1; + } + return memcmp(buf, TEST, sizeof(TEST)); +} + +static int recv_fd(int desc) +{ + unsigned char buf[CMSG_SPACE(sizeof(int))]; + struct msghdr msg; + struct cmsghdr *cmsg; + struct iovec iov[1]; + char dummy; + int ret=2; + + memset(&msg, 0, sizeof(msg)); + iov[0].iov_base = &dummy; + iov[0].iov_len = 1; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + + if (recvmsg(desc, &msg, 0) == -1) { + perror("recvmsg failed!"); + return -1; + } + if ((msg.msg_flags & MSG_TRUNC) || (msg.msg_flags & MSG_CTRUNC)) { + fprintf(stderr, "control message truncated"); + return -1; + } + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_len == CMSG_LEN(sizeof(int)) && + cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_RIGHTS) { + int fd = *(int *)CMSG_DATA(cmsg); + ret = testfd(fd); + close(fd); + } + } + return ret; +} + +int main(void) +{ + int fd[2]; + int pip[2]; + pid_t pid; + int status; + + if(pipe(pip)) { + perror("pipe"); + return 1; + } + + if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) { + perror("socketpair"); + return 1; + } + + if((pid=fork()) < 0) { + perror("fork"); + } else if (!pid) { + exit( recv_fd(fd[1]) ); + } else { + /* parent */ + if(send_fd(fd[0], pip[0]) == -1) { + kill(pid, 9); + waitpid(pid, NULL, 0); + return 2; + } + if(write(pip[1], TEST, sizeof(TEST)) != sizeof(TEST)) { + close(pip[1]); + return -1; + } + close(pip[1]); + waitpid(pid, &status, 0); + } + return status; +} + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_fdpass=1; fdpass_need_xopen=0 +else + have_fdpass=0 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + + if test $have_fdpass = 0; then + if test "$cross_compiling" = yes; then : + have_fdpass=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _XOPEN_SOURCE 500 +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_UIO_H +#include +#endif +#include +#include + +#if !defined CMSG_SPACE || !defined CMSG_LEN +#ifndef ALIGN +#define ALIGN(len) len +#endif + +#ifndef CMSG_SPACE +#define CMSG_SPACE(len) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(len)) +#endif + +#ifndef CMSG_LEN +#define CMSG_LEN(len) (ALIGN(sizeof(struct cmsghdr)) + len) +#endif +#endif + +#define TEST "test" + +static int send_fd(int s, int fd) +{ + struct msghdr msg; + struct cmsghdr *cmsg; + unsigned char fdbuf[CMSG_SPACE(sizeof(int))]; + struct iovec iov[1]; + char dummy[] = ""; + + iov[0].iov_base = dummy; + iov[0].iov_len = 1; + + memset(&msg, 0, sizeof(msg)); + msg.msg_control = fdbuf; + /* must send/receive at least one byte */ + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_controllen = CMSG_LEN(sizeof(int)); + + cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_len = CMSG_LEN(sizeof(int)); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; *(int *)CMSG_DATA(cmsg) = fd; - if (sendmsg(s, &msg, 0) == -1) { - perror("sendmsg"); - close(s); - return -1; - } - return 0; -} + if (sendmsg(s, &msg, 0) == -1) { + perror("sendmsg"); + close(s); + return -1; + } + return 0; +} + +static int testfd(int desc) +{ + char buf[256]; + if(read(desc, buf, sizeof(buf)) != sizeof(TEST)) { + fprintf(stderr, "test data not received correctly!"); + return 1; + } + return memcmp(buf, TEST, sizeof(TEST)); +} + +static int recv_fd(int desc) +{ + unsigned char buf[CMSG_SPACE(sizeof(int))]; + struct msghdr msg; + struct cmsghdr *cmsg; + struct iovec iov[1]; + char dummy; + int ret=2; + + memset(&msg, 0, sizeof(msg)); + iov[0].iov_base = &dummy; + iov[0].iov_len = 1; + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_control = buf; + msg.msg_controllen = sizeof(buf); + + if (recvmsg(desc, &msg, 0) == -1) { + perror("recvmsg failed!"); + return -1; + } + if ((msg.msg_flags & MSG_TRUNC) || (msg.msg_flags & MSG_CTRUNC)) { + fprintf(stderr, "control message truncated"); + return -1; + } + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; + cmsg = CMSG_NXTHDR(&msg, cmsg)) { + if (cmsg->cmsg_len == CMSG_LEN(sizeof(int)) && + cmsg->cmsg_level == SOL_SOCKET && + cmsg->cmsg_type == SCM_RIGHTS) { + int fd = *(int *)CMSG_DATA(cmsg); + ret = testfd(fd); + close(fd); + } + } + return ret; +} + +int main(void) +{ + int fd[2]; + int pip[2]; + pid_t pid; + int status; + + if(pipe(pip)) { + perror("pipe"); + return 1; + } + + if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) { + perror("socketpair"); + return 1; + } + + if((pid=fork()) < 0) { + perror("fork"); + } else if (!pid) { + exit( recv_fd(fd[1]) ); + } else { + /* parent */ + if(send_fd(fd[0], pip[0]) == -1) { + kill(pid, 9); + waitpid(pid, NULL, 0); + return 2; + } + if(write(pip[1], TEST, sizeof(TEST)) != sizeof(TEST)) { + close(pip[1]); + return -1; + } + close(pip[1]); + waitpid(pid, &status, 0); + } + return status; +} + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + have_fdpass=1; fdpass_need_xopen=1 +else + have_fdpass=0 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + + if test $have_fdpass = 1; then + +$as_echo "#define HAVE_FD_PASSING 1" >>confdefs.h + + if test $fdpass_need_xopen = 1; then + +$as_echo "#define FDPASS_NEED_XOPEN 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, by defining _XOPEN_SOURCE" >&5 +$as_echo "yes, by defining _XOPEN_SOURCE" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + fi +fi + + +# Check whether --enable-clamdtop was given. +if test "${enable_clamdtop+set}" = set; then : + enableval=$enable_clamdtop; enable_clamdtop=$enableval +else + enable_clamdtop="auto" +fi + + +if test "$enable_clamdtop" != "no"; then + + + + + + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + + + + + use_additional=yes + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + +# Check whether --with-libncurses-prefix was given. +if test "${with_libncurses_prefix+set}" = set; then : + withval=$with_libncurses_prefix; + if test "X$withval" = "Xno"; then + use_additional=no + else + additional_compat_libdir= + if test "X$withval" = "X"; then + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + if test "X$acl_libdirstem" != "Xlib"; then + additional_compat_libdir="-L$withval/lib" + fi + fi + fi + +fi + + LIBNCURSES= + LTLIBNCURSES= + INCNCURSES= + LIBNCURSES_PREFIX= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='ncurses ' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }$value" + else + : + fi + else + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + dir="$additional_libdir" + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + if test "X$found_dir" = "X"; then + compat_libdir= + if test "X$acl_libdirstem" != "Xlib"; then + compat_libdir=-L'${exec_prefix}'/lib + fi + for x in $LDFLAGS $LTLIBNCURSES $compat_libdir $additional_compat_libdir; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -static int testfd(int desc) -{ - char buf[256]; - if(read(desc, buf, sizeof(buf)) != sizeof(TEST)) { - fprintf(stderr, "test data not received correctly!"); - return 1; - } - return memcmp(buf, TEST, sizeof(TEST)); -} + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext"; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + else + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + if test "$acl_hardcode_direct" = yes; then + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + haveit= + for x in $LDFLAGS $LIBNCURSES; do -static int recv_fd(int desc) -{ - unsigned char buf[CMSG_SPACE(sizeof(int))]; - struct msghdr msg; - struct cmsghdr *cmsg; - struct iovec iov[1]; - char dummy; - int ret=2; + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - memset(&msg, 0, sizeof(msg)); - iov[0].iov_base = &dummy; - iov[0].iov_len = 1; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_control = buf; - msg.msg_controllen = sizeof(buf); + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + else + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_a" + else + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-L$found_dir -l$name" + fi + fi + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + LIBNCURSES_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + */lib | */lib/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/lib/"'*$,,'` + LIBNCURSES_PREFIX="$basedir" + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INCNCURSES; do - if (recvmsg(desc, &msg, 0) == -1) { - perror("recvmsg failed!"); - return -1; - } - if ((msg.msg_flags & MSG_TRUNC) || (msg.msg_flags & MSG_CTRUNC)) { - fprintf(stderr, "control message truncated"); - return -1; - } - for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; - cmsg = CMSG_NXTHDR(&msg, cmsg)) { - if (cmsg->cmsg_len == CMSG_LEN(sizeof(int)) && - cmsg->cmsg_level == SOL_SOCKET && - cmsg->cmsg_type == SCM_RIGHTS) { - int fd = *(int *)CMSG_DATA(cmsg); - ret = testfd(fd); - close(fd); - } - } - return ret; -} + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" -int main(void) -{ - int fd[2]; - int pip[2]; - pid_t pid; - int status; + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + INCNCURSES="${INCNCURSES}${INCNCURSES:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + if test -n "$found_la"; then + save_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$save_libdir" + for dep in $dependency_libs; do + case "$dep" in + -L*) + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIBNCURSES; do - if(pipe(pip)) { - perror("pipe"); - return 1; - } + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" - if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) { - perror("socketpair"); - return 1; - } + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-L$additional_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIBNCURSES; do - if((pid=fork()) < 0) { - perror("fork"); - } else if (!pid) { - exit( recv_fd(fd[1]) ); - } else { - /* parent */ - if(send_fd(fd[0], pip[0]) == -1) { - kill(pid, 9); - waitpid(pid, NULL, 0); - return 2; - } - if(write(pip[1], TEST, sizeof(TEST)) != sizeof(TEST)) { - close(pip[1]); - return -1; - } - close(pip[1]); - waitpid(pid, &status, 0); - } - return status; -} + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-L$additional_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + ;; + *.la) + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$dep" + LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }$dep" + ;; + esac + done + fi + else + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-l$name" + LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + acl_save_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$flag" + else + for found_dir in $rpathdirs; do + acl_save_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_save_libdir" + LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + for found_dir in $ltrpathdirs; do + LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-R$found_dir" + done + fi -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - have_fdpass=1; fdpass_need_xopen=1 + CPPFLAGS="$CPPFLAGS $INCNCURSES" + ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : + have_header=yes else - have_fdpass=0 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + have_header=no fi - fi - - if test $have_fdpass = 1; then -$as_echo "#define HAVE_FD_PASSING 1" >>confdefs.h + ac_cv_findlib_NCURSES_libs= + ac_cv_findlib_NCURSES_ltlibs= + ac_cv_findlib_NCURSES_inc= + if test "$have_header" = "yes"; then : - if test $fdpass_need_xopen = 1; then + LIBS="$LIBS $LIBNCURSES" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking with ncurses" >&5 +$as_echo_n "checking linking with ncurses... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +initscr(); KEY_RESIZE; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : -$as_echo "#define FDPASS_NEED_XOPEN 1" >>confdefs.h + ac_cv_findlib_NCURSES_libs="$LIBNCURSES" + ac_cv_findlib_NCURSES_ltlibs="$LTLIBNCURSES" + ac_cv_findlib_NCURSES_inc="$INCNCURSES" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, by defining _XOPEN_SOURCE" >&5 -$as_echo "yes, by defining _XOPEN_SOURCE" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } - fi fi + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + if test "X$ac_cv_findlib_NCURSES_libs" = "X"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: unable to compile/link with ncurses" >&5 +$as_echo "$as_me: unable to compile/link with ncurses" >&6;} + HAVE_LIBNCURSES=no -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +else + { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with ncurses by using $ac_cv_findlib_NCURSES_inc $ac_cv_findlib_NCURSES_libs" >&5 +$as_echo "$as_me: Compiling and linking with ncurses by using $ac_cv_findlib_NCURSES_inc $ac_cv_findlib_NCURSES_libs" >&6;} -cat >>confdefs.h <<_ACEOF -#define VERSION_SUFFIX "$VERSION_SUFFIX" -_ACEOF +$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h + HAVE_LIBNCURSES=yes + LIBNCURSES="$ac_cv_findlib_NCURSES_libs" + LTLIBNCURSES="$ac_cv_findlib_NCURSES_ltlibs" + INCNCURSES="$ac_cv_findlib_NCURSES_inc" + CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES"; + CURSES_INCLUDE="" -# Check whether --enable-clamdtop was given. -if test "${enable_clamdtop+set}" = set; then : - enableval=$enable_clamdtop; enable_clamdtop=$enableval -else - enable_clamdtop="auto" fi -if test "$enable_clamdtop" != "no"; then +if test "X$HAVE_LIBNCURSES" != "Xyes"; then + HAVE_LIBNCURSES= @@ -19969,8 +20676,8 @@ fi fi CPPFLAGS="$CPPFLAGS $INCNCURSES" - ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then : + ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncurses_h" = xyes; then : have_header=yes else have_header=no @@ -19987,7 +20694,7 @@ fi $as_echo_n "checking linking with ncurses... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int main () { @@ -20030,14 +20737,14 @@ $as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h LTLIBNCURSES="$ac_cv_findlib_NCURSES_ltlibs" INCNCURSES="$ac_cv_findlib_NCURSES_inc" CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES"; - CURSES_INCLUDE="" + CURSES_INCLUDE="" fi +fi if test "X$HAVE_LIBNCURSES" != "Xyes"; then - HAVE_LIBNCURSES= @@ -20063,9 +20770,9 @@ if test "X$HAVE_LIBNCURSES" != "Xyes"; then prefix="$acl_save_prefix" -# Check whether --with-libncurses-prefix was given. -if test "${with_libncurses_prefix+set}" = set; then : - withval=$with_libncurses_prefix; +# Check whether --with-libpdcurses-prefix was given. +if test "${with_libpdcurses_prefix+set}" = set; then : + withval=$with_libpdcurses_prefix; if test "X$withval" = "Xno"; then use_additional=no else @@ -20094,14 +20801,14 @@ if test "${with_libncurses_prefix+set}" = set; then : fi - LIBNCURSES= - LTLIBNCURSES= - INCNCURSES= - LIBNCURSES_PREFIX= + LIBPDCURSES= + LTLIBPDCURSES= + INCPDCURSES= + LIBPDCURSES_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= - names_next_round='ncurses ' + names_next_round='pdcurses ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= @@ -20120,9 +20827,9 @@ fi if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" - test -z "$value" || LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$value" + test -z "$value" || LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$value" eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }$value" + test -z "$value" || LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }$value" else : fi @@ -20183,7 +20890,7 @@ fi if test "X$acl_libdirstem" != "Xlib"; then compat_libdir=-L'${exec_prefix}'/lib fi - for x in $LDFLAGS $LTLIBNCURSES $compat_libdir $additional_compat_libdir; do + for x in $LDFLAGS $LTLIBPDCURSES $compat_libdir $additional_compat_libdir; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -20242,10 +20949,10 @@ fi done fi if test "X$found_dir" != "X"; then - LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-L$found_dir -l$name" + LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" else haveit= for x in $ltrpathdirs; do @@ -20258,10 +20965,10 @@ fi ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then @@ -20274,7 +20981,7 @@ fi fi else haveit= - for x in $LDFLAGS $LIBNCURSES; do + for x in $LDFLAGS $LIBPDCURSES; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -20290,33 +20997,33 @@ fi fi done if test -z "$haveit"; then - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-L$found_dir" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_so" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" else - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-l$name" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$found_a" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_a" else - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-L$found_dir -l$name" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBNCURSES_PREFIX="$basedir" + LIBPDCURSES_PREFIX="$basedir" additional_includedir="$basedir/include" ;; */lib | */lib/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/lib/"'*$,,'` - LIBNCURSES_PREFIX="$basedir" + LIBPDCURSES_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac @@ -20331,7 +21038,7 @@ fi fi fi if test -z "$haveit"; then - for x in $CPPFLAGS $INCNCURSES; do + for x in $CPPFLAGS $INCPDCURSES; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -20348,7 +21055,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then - INCNCURSES="${INCNCURSES}${INCNCURSES:+ }-I$additional_includedir" + INCPDCURSES="${INCPDCURSES}${INCPDCURSES:+ }-I$additional_includedir" fi fi fi @@ -20376,7 +21083,7 @@ fi fi if test -z "$haveit"; then haveit= - for x in $LDFLAGS $LIBNCURSES; do + for x in $LDFLAGS $LIBPDCURSES; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -20393,11 +21100,11 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-L$additional_libdir" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-L$additional_libdir" fi fi haveit= - for x in $LDFLAGS $LTLIBNCURSES; do + for x in $LDFLAGS $LTLIBPDCURSES; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" @@ -20414,7 +21121,7 @@ fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then - LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-L$additional_libdir" + LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-L$additional_libdir" fi fi fi @@ -20452,15 +21159,15 @@ fi names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$dep" - LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }$dep" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$dep" + LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }$dep" ;; esac done fi else - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }-l$name" - LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-l$name" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-l$name" + LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-l$name" fi fi fi @@ -20476,43 +21183,43 @@ fi libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$flag" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" - LIBNCURSES="${LIBNCURSES}${LIBNCURSES:+ }$flag" + LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do - LTLIBNCURSES="${LTLIBNCURSES}${LTLIBNCURSES:+ }-R$found_dir" + LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-R$found_dir" done fi - CPPFLAGS="$CPPFLAGS $INCNCURSES" - ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" -if test "x$ac_cv_header_ncurses_h" = xyes; then : + CPPFLAGS="$CPPFLAGS $INCPDCURSES" + ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" +if test "x$ac_cv_header_curses_h" = xyes; then : have_header=yes else have_header=no fi - ac_cv_findlib_NCURSES_libs= - ac_cv_findlib_NCURSES_ltlibs= - ac_cv_findlib_NCURSES_inc= + ac_cv_findlib_PDCURSES_libs= + ac_cv_findlib_PDCURSES_ltlibs= + ac_cv_findlib_PDCURSES_inc= if test "$have_header" = "yes"; then : - LIBS="$LIBS $LIBNCURSES" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking with ncurses" >&5 -$as_echo_n "checking linking with ncurses... " >&6; } + LIBS="$LIBS $LIBPDCURSES" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking with pdcurses" >&5 +$as_echo_n "checking linking with pdcurses... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int main () { @@ -20523,9 +21230,9 @@ initscr(); KEY_RESIZE; _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_findlib_NCURSES_libs="$LIBNCURSES" - ac_cv_findlib_NCURSES_ltlibs="$LTLIBNCURSES" - ac_cv_findlib_NCURSES_inc="$INCNCURSES" + ac_cv_findlib_PDCURSES_libs="$LIBPDCURSES" + ac_cv_findlib_PDCURSES_ltlibs="$LTLIBPDCURSES" + ac_cv_findlib_PDCURSES_inc="$INCPDCURSES" { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } @@ -20536,643 +21243,538 @@ rm -f core conftest.err conftest.$ac_objext \ fi CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" - if test "X$ac_cv_findlib_NCURSES_libs" = "X"; then : + if test "X$ac_cv_findlib_PDCURSES_libs" = "X"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: unable to compile/link with ncurses" >&5 -$as_echo "$as_me: unable to compile/link with ncurses" >&6;} - HAVE_LIBNCURSES=no + { $as_echo "$as_me:${as_lineno-$LINENO}: unable to compile/link with pdcurses" >&5 +$as_echo "$as_me: unable to compile/link with pdcurses" >&6;} + HAVE_LIBPDCURSES=no + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** not building clamdtop: ncurses not found" >&5 +$as_echo "$as_me: WARNING: ****** not building clamdtop: ncurses not found" >&2;} + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with pdcurses by using $ac_cv_findlib_PDCURSES_inc $ac_cv_findlib_PDCURSES_libs" >&5 +$as_echo "$as_me: Compiling and linking with pdcurses by using $ac_cv_findlib_PDCURSES_inc $ac_cv_findlib_PDCURSES_libs" >&6;} + +$as_echo "#define HAVE_LIBPDCURSES 1" >>confdefs.h + + HAVE_LIBPDCURSES=yes + LIBPDCURSES="$ac_cv_findlib_PDCURSES_libs" + LTLIBPDCURSES="$ac_cv_findlib_PDCURSES_ltlibs" + INCPDCURSES="$ac_cv_findlib_PDCURSES_inc" + CURSES_CPPFLAGS="$INCPDCURSES"; + CURSES_LIBS="$LTLIBPDCURSES"; + CURSES_INCLUDE="" + +fi + + +fi + +if test "x$CURSES_LIBS" = "x" -a "$enable_clamdtop" = "yes"; then + as_fn_error $? " + +ERROR! Clamdtop was configured, but not found. You need to install libncurses5-dev. +" "$LINENO" 5 +fi + +fi + + +cat >>confdefs.h <<_ACEOF +#define CURSES_INCLUDE $CURSES_INCLUDE +_ACEOF + + if test "X$HAVE_LIBNCURSES" = "Xyes" || test "X$HAVE_LIBPDCURSES" = "Xyes"; then + HAVE_CURSES_TRUE= + HAVE_CURSES_FALSE='#' else + HAVE_CURSES_TRUE='#' + HAVE_CURSES_FALSE= +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with ncurses by using $ac_cv_findlib_NCURSES_inc $ac_cv_findlib_NCURSES_libs" >&5 -$as_echo "$as_me: Compiling and linking with ncurses by using $ac_cv_findlib_NCURSES_inc $ac_cv_findlib_NCURSES_libs" >&6;} -$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h +# Check whether --enable-distcheck-werror was given. +if test "${enable_distcheck_werror+set}" = set; then : + enableval=$enable_distcheck_werror; enable_distcheckwerror=$enableval +else + enable_distcheckwerror="no" +fi - HAVE_LIBNCURSES=yes - LIBNCURSES="$ac_cv_findlib_NCURSES_libs" - LTLIBNCURSES="$ac_cv_findlib_NCURSES_ltlibs" - INCNCURSES="$ac_cv_findlib_NCURSES_inc" - CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES"; - CURSES_INCLUDE="" +# Enable distcheck warnings and Werror only for gcc versions that support them, +# and only after we've run the configure tests. +# Some configure tests fail (like checking for cos in -lm) if we enable these +# Werror flags for configure too (for example -Wstrict-prototypes makes +# configure think that -lm doesn't have cos, hence its in libc). +WERR_CFLAGS= +WERR_CFLAGS_MILTER= +if test "x$enable_distcheckwerror" = "xyes"; then + if test "$distcheck_enable_flags" = "1"; then + WERR_COMMON="-Wno-pointer-sign -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wno-error=strict-aliasing -Wno-error=bad-function-cast -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wno-error=type-limits -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=aggregate-return" + WERR_CFLAGS="$WERR_COMMON -Wwrite-strings" + WERR_CFLAGS_MILTER="$WERR_COMMON -Wno-error=format-nonliteral" + fi fi + +# Check whether --enable-llvm was given. +if test "${enable_llvm+set}" = set; then : + enableval=$enable_llvm; enable_llvm=$enableval +else + enable_llvm="auto" fi -if test "X$HAVE_LIBNCURSES" != "Xyes"; then +if test "$enable_llvm" != "no"; then +subdirs="$subdirs " - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" +subdirfailed=no +subdirs="$subdirs libclamav/c++" - use_additional=yes +fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +# Check whether --enable-sha-collector-for-internal-use was given. +if test "${enable_sha_collector_for_internal_use+set}" = set; then : + enableval=$enable_sha_collector_for_internal_use; enable_sha_collector="yes" +else + enable_sha_collector="no" +fi - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +if test "$enable_sha_collector" != "no"; then - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +$as_echo "#define HAVE__INTERNAL__SHA_COLLECT 1" >>confdefs.h +fi -# Check whether --with-libpdcurses-prefix was given. -if test "${with_libpdcurses_prefix+set}" = set; then : - withval=$with_libpdcurses_prefix; - if test "X$withval" = "Xno"; then - use_additional=no - else - additional_compat_libdir= - if test "X$withval" = "X"; then - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" +case "$host_os" in +freebsd*) +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kinfo_getvmmap in -lutil" >&5 +$as_echo_n "checking for kinfo_getvmmap in -lutil... " >&6; } +if ${ac_cv_lib_util_kinfo_getvmmap+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lutil $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char kinfo_getvmmap (); +int +main () +{ +return kinfo_getvmmap (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_util_kinfo_getvmmap=yes +else + ac_cv_lib_util_kinfo_getvmmap=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_kinfo_getvmmap" >&5 +$as_echo "$ac_cv_lib_util_kinfo_getvmmap" >&6; } +if test "x$ac_cv_lib_util_kinfo_getvmmap" = xyes; then : + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lutil" +else + as_fn_error $? "You are running BSD but you don't have kinfo_getvmmap in the util library. Please fix manually." "$LINENO" 5 +fi + +;; +esac + + +have_curl="no" +curl_msg="Please use the web interface for submitting FPs/FNs." +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl installation" >&5 +$as_echo_n "checking for libcurl installation... " >&6; } + + +# Check whether --with-libcurl was given. +if test "${with_libcurl+set}" = set; then : + withval=$with_libcurl; +if test "$withval"; then + LIBCURL_HOME="$withval" +fi + +else - eval additional_includedir=\"$includedir\" - eval additional_libdir=\"$libdir\" +LIBCURL_HOME=/usr/local +if test ! -f "$LIBCURL_HOME/include/curl/curl.h" +then + LIBCURL_HOME=/usr +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCURL_HOME" >&5 +$as_echo "$LIBCURL_HOME" >&6; } - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +fi - else - additional_includedir="$withval/include" - additional_libdir="$withval/$acl_libdirstem" - if test "X$acl_libdirstem" != "Xlib"; then - additional_compat_libdir="-L$withval/lib" - fi - fi + +if test ! -f "$LIBCURL_HOME/include/curl/curl.h" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&5 +$as_echo "$as_me: WARNING: libcurl not found. Please use the web interface for submitting FPs/FNs." >&2;} +else + if test -f "$LIBCURL_HOME/bin/curl-config"; then + CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs) + CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags) + else + CURL_LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" + CURL_CPPFLAGS="-I$LIBCURL_HOME/include" fi + save_LDFLAGS="$LDFLAGS" + LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5 +$as_echo_n "checking for curl_easy_init in -lcurl... " >&6; } +if ${ac_cv_lib_curl_curl_easy_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char curl_easy_init (); +int +main () +{ +return curl_easy_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_curl_curl_easy_init=yes +else + ac_cv_lib_curl_curl_easy_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_easy_init" >&5 +$as_echo "$ac_cv_lib_curl_curl_easy_init" >&6; } +if test "x$ac_cv_lib_curl_curl_easy_init" = xyes; then : + curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs." >&5 +$as_echo "$as_me: WARNING: Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs." >&2;} +fi + fi - LIBPDCURSES= - LTLIBPDCURSES= - INCPDCURSES= - LIBPDCURSES_PREFIX= - rpathdirs= - ltrpathdirs= - names_already_handled= - names_next_round='pdcurses ' - while test -n "$names_next_round"; do - names_this_round="$names_next_round" - names_next_round= - for name in $names_this_round; do - already_handled= - for n in $names_already_handled; do - if test "$n" = "$name"; then - already_handled=yes - break - fi - done - if test -z "$already_handled"; then - names_already_handled="$names_already_handled $name" - uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` - eval value=\"\$HAVE_LIB$uppername\" - if test -n "$value"; then - if test "$value" = yes; then - eval value=\"\$LIB$uppername\" - test -z "$value" || LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$value" - eval value=\"\$LTLIB$uppername\" - test -z "$value" || LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }$value" - else - : - fi - else - found_dir= - found_la= - found_so= - found_a= - eval libname=\"$acl_libname_spec\" # typically: libname=lib$name - if test -n "$acl_shlibext"; then - shrext=".$acl_shlibext" # typically: shrext=.so - else - shrext= - fi - if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - fi - if test "X$found_dir" = "X"; then - compat_libdir= - if test "X$acl_libdirstem" != "Xlib"; then - compat_libdir=-L'${exec_prefix}'/lib - fi - for x in $LDFLAGS $LTLIBPDCURSES $compat_libdir $additional_compat_libdir; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - case "$x" in - -L*) - dir=`echo "X$x" | sed -e 's/^X-L//'` - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" - fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then - found_dir="$dir" - found_so="$dir/$f" - break - fi - done - fi - fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi - ;; - esac - if test "X$found_dir" != "X"; then - break - fi - done - fi - if test "X$found_dir" != "X"; then - LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-L$found_dir -l$name" - if test "X$found_so" != "X"; then - if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" - else - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $found_dir" - fi - if test "$acl_hardcode_direct" = yes; then - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" - else - if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $found_dir" - fi - else - haveit= - for x in $LDFLAGS $LIBPDCURSES; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libconfig installation" >&5 +$as_echo_n "checking for libconfig installation... " >&6; } - if test "X$x" = "X-L$found_dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-L$found_dir" - fi - if test "$acl_hardcode_minus_L" != no; then - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_so" - else - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-l$name" - fi - fi - fi - fi - else - if test "X$found_a" != "X"; then - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$found_a" - else - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-L$found_dir -l$name" - fi - fi - additional_includedir= - case "$found_dir" in - */$acl_libdirstem | */$acl_libdirstem/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` - LIBPDCURSES_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - */lib | */lib/) - basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/lib/"'*$,,'` - LIBPDCURSES_PREFIX="$basedir" - additional_includedir="$basedir/include" - ;; - esac - if test "X$additional_includedir" != "X"; then - if test "X$additional_includedir" != "X/usr/include"; then - haveit= - if test "X$additional_includedir" = "X/usr/local/include"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - for x in $CPPFLAGS $INCPDCURSES; do - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +# Check whether --with-libconfig was given. +if test "${with_libconfig+set}" = set; then : + withval=$with_libconfig; +if test "$withval"; then + LIBCONFIG_HOME="$withval" +fi - if test "X$x" = "X-I$additional_includedir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_includedir"; then - INCPDCURSES="${INCPDCURSES}${INCPDCURSES:+ }-I$additional_includedir" - fi - fi - fi - fi - fi - if test -n "$found_la"; then - save_libdir="$libdir" - case "$found_la" in - */* | *\\*) . "$found_la" ;; - *) . "./$found_la" ;; - esac - libdir="$save_libdir" - for dep in $dependency_libs; do - case "$dep" in - -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then - haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then - if test -n "$GCC"; then - case $host_os in - linux* | gnu* | k*bsd*-gnu) haveit=yes;; - esac - fi - fi - if test -z "$haveit"; then - haveit= - for x in $LDFLAGS $LIBPDCURSES; do +else - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" +LIBCONFIG_HOME=/usr/local +if test ! -f "$LIBCONFIG_HOME/include/libconfig.h" +then + LIBCONFIG_HOME=/usr +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCONFIG_HOME" >&5 +$as_echo "$LIBCONFIG_HOME" >&6; } - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-L$additional_libdir" - fi - fi - haveit= - for x in $LDFLAGS $LTLIBPDCURSES; do +fi - acl_save_prefix="$prefix" - prefix="$acl_final_prefix" - acl_save_exec_prefix="$exec_prefix" - exec_prefix="$acl_final_exec_prefix" - eval x=\"$x\" - exec_prefix="$acl_save_exec_prefix" - prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-L$additional_libdir" - fi - fi - fi - fi - ;; - -R*) - dir=`echo "X$dep" | sed -e 's/^X-R//'` - if test "$enable_rpath" != no; then - haveit= - for x in $rpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - rpathdirs="$rpathdirs $dir" - fi - haveit= - for x in $ltrpathdirs; do - if test "X$x" = "X$dir"; then - haveit=yes - break - fi - done - if test -z "$haveit"; then - ltrpathdirs="$ltrpathdirs $dir" - fi - fi - ;; - -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` - ;; - *.la) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` - ;; - *) - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$dep" - LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }$dep" - ;; - esac - done - fi - else - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }-l$name" - LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-l$name" - fi - fi - fi - done - done - if test "X$rpathdirs" != "X"; then - if test -n "$acl_hardcode_libdir_separator"; then - alldirs= - for found_dir in $rpathdirs; do - alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" - done - acl_save_libdir="$libdir" - libdir="$alldirs" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$flag" - else - for found_dir in $rpathdirs; do - acl_save_libdir="$libdir" - libdir="$found_dir" - eval flag=\"$acl_hardcode_libdir_flag_spec\" - libdir="$acl_save_libdir" - LIBPDCURSES="${LIBPDCURSES}${LIBPDCURSES:+ }$flag" - done +if test ! -f "$LIBCONFIG_HOME/include/libconfig.h" +then + as_fn_error $? "libconfig not found." "$LINENO" 5 +fi + +save_LDFLAGS="$LDFLAGS" +LDFLAGS="-L$LIBCONFIG_HOME/lib -lconfig" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for config_init in -lconfig" >&5 +$as_echo_n "checking for config_init in -lconfig... " >&6; } +if ${ac_cv_lib_config_config_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lconfig $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char config_init (); +int +main () +{ +return config_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_config_config_init=yes +else + ac_cv_lib_config_config_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_config_config_init" >&5 +$as_echo "$ac_cv_lib_config_config_init" >&6; } +if test "x$ac_cv_lib_config_config_init" = xyes; then : + FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +else + as_fn_error $? "Your libconfig installation is misconfigured" "$LINENO" 5 +fi + + +CLAMSCAN_LIBS="$CLAMSCAN_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMD_LIBS="$CLAMD_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMMEM_LIBS="$CLAMMEM_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMDTOP_LIBS="$CLAMDTOP_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMBC_LIBS="$CLAMBC_LIBS -L$LIBCONFIG_HOME/lib -lconfig" + +CLAMSCAN_CPPFLAGS="$FRESHCLAM_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMDSCAN_CPPFLAGS="$CLAMDSCAN_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMD_CPPFLAGS="$CLAMD_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMMEM_CPPFLAGS="$CLAMMEM_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMAV_MILTER_CPPFLAGS="$CLAMAV_MILTER_CPPFLAGS -I$LIBCONFIG_HOME/include" +LIBCLAMAV_CPPFLAGS="$LIBCLAMAV_CPPFLAGS -I$LIBCONFIG_HOME/include" +LIBCLAMSHARED_CPPFLAGS="$LIBCLAMSHARED_CPPFLAGS -I$LIBCONFIG_HOME/include" +SIGTOOL_CPPFLAGS="$SIGTOOL_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMCONF_CPPFLAGS="$CLAMCONF_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMDTOP_CPPFLAGS="$CLAMDTOP_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMBC_CPPFLAGS="$CLAMBC_CPPFLAGS -I$LIBCONFIG_HOME/include" + +LDFLAGS="$save_ldflags" + + +want_xml="auto" +# Check whether --enable-xml was given. +if test "${enable_xml+set}" = set; then : + enableval=$enable_xml; want_xml=$enableval +else + want_xml="auto" +fi + + +XML_HOME="" +if test "X$want_xml" != "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2 installation" >&5 +$as_echo_n "checking for libxml2 installation... " >&6; } + +# Check whether --with-xml was given. +if test "${with_xml+set}" = set; then : + withval=$with_xml; + if test "$withval" + then + XML_HOME="$withval" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using $XML_HOME" >&5 +$as_echo "using $XML_HOME" >&6; } + else + as_fn_error $? "cannot assign blank value to --with-xml" "$LINENO" 5 + fi + +else + + XML_HOME=/usr/local + if test ! -x "$XML_HOME/bin/xml2-config" + then + XML_HOME=/usr + if test ! -x "$XML_HOME/bin/xml2-config" + then + XML_HOME="" fi fi - if test "X$ltrpathdirs" != "X"; then - for found_dir in $ltrpathdirs; do - LTLIBPDCURSES="${LTLIBPDCURSES}${LTLIBPDCURSES:+ }-R$found_dir" - done + if test "x$XML_HOME" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML_HOME" >&5 +$as_echo "$XML_HOME" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } fi - CPPFLAGS="$CPPFLAGS $INCPDCURSES" - ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" -if test "x$ac_cv_header_curses_h" = xyes; then : - have_header=yes -else - have_header=no fi +fi - ac_cv_findlib_PDCURSES_libs= - ac_cv_findlib_PDCURSES_ltlibs= - ac_cv_findlib_PDCURSES_inc= - if test "$have_header" = "yes"; then : +found_xml="no" +XMLCONF_VERSION="" +XML_CPPFLAGS="" +XML_LIBS="" +if test "x$XML_HOME" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking xml2-config version" >&5 +$as_echo_n "checking xml2-config version... " >&6; } + XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`" + if test "x%XMLCONF_VERSION" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLCONF_VERSION" >&5 +$as_echo "$XMLCONF_VERSION" >&6; } + found_xml="yes" + XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`" + XML_LIBS="`$XML_HOME/bin/xml2-config --libs`" + else + as_fn_error $? "xml2-config failed" "$LINENO" 5 + fi +fi - LIBS="$LIBS $LIBPDCURSES" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking with pdcurses" >&5 -$as_echo_n "checking linking with pdcurses... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +working_xml="no" +if test "X$found_xml" != "Xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlreader.h in $XML_HOME" >&5 +$as_echo_n "checking for xmlreader.h in $XML_HOME... " >&6; } + + if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } + save_LIBS="$LIBS" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $XML_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlTextReaderRead in -lxml2" >&5 +$as_echo_n "checking for xmlTextReaderRead in -lxml2... " >&6; } +if ${ac_cv_lib_xml2_xmlTextReaderRead+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxml2 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char xmlTextReaderRead (); int main () { -initscr(); KEY_RESIZE; +return xmlTextReaderRead (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - - ac_cv_findlib_PDCURSES_libs="$LIBPDCURSES" - ac_cv_findlib_PDCURSES_ltlibs="$LTLIBPDCURSES" - ac_cv_findlib_PDCURSES_inc="$INCPDCURSES" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - + ac_cv_lib_xml2_xmlTextReaderRead=yes +else + ac_cv_lib_xml2_xmlTextReaderRead=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - +LIBS=$ac_check_lib_save_LIBS fi - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" - if test "X$ac_cv_findlib_PDCURSES_libs" = "X"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: unable to compile/link with pdcurses" >&5 -$as_echo "$as_me: unable to compile/link with pdcurses" >&6;} - HAVE_LIBPDCURSES=no - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ****** not building clamdtop: ncurses not found" >&5 -$as_echo "$as_me: WARNING: ****** not building clamdtop: ncurses not found" >&2;} - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlTextReaderRead" >&5 +$as_echo "$ac_cv_lib_xml2_xmlTextReaderRead" >&6; } +if test "x$ac_cv_lib_xml2_xmlTextReaderRead" = xyes; then : + working_xml="yes" else + working_xml="no" +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with pdcurses by using $ac_cv_findlib_PDCURSES_inc $ac_cv_findlib_PDCURSES_libs" >&5 -$as_echo "$as_me: Compiling and linking with pdcurses by using $ac_cv_findlib_PDCURSES_inc $ac_cv_findlib_PDCURSES_libs" >&6;} -$as_echo "#define HAVE_LIBPDCURSES 1" >>confdefs.h + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + fi +fi - HAVE_LIBPDCURSES=yes - LIBPDCURSES="$ac_cv_findlib_PDCURSES_libs" - LTLIBPDCURSES="$ac_cv_findlib_PDCURSES_ltlibs" - INCPDCURSES="$ac_cv_findlib_PDCURSES_inc" - CURSES_CPPFLAGS="$INCPDCURSES"; - CURSES_LIBS="$LTLIBPDCURSES"; - CURSES_INCLUDE="" +if test "$working_xml" = "yes"; then -fi +$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h -fi -if test "x$CURSES_LIBS" = "x" -a "$enable_clamdtop" = "yes"; then - as_fn_error $? " + { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling and linking with libxml2 from $XML_HOME" >&5 +$as_echo "$as_me: Compiling and linking with libxml2 from $XML_HOME" >&6;} +else + if test "$want_xml" = "yes"; then + as_fn_error $? "****** Please install libxml2 packages!" "$LINENO" 5 + else + if test "$want_xml" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: ****** libxml2 support unavailable" >&5 +$as_echo "$as_me: ****** libxml2 support unavailable" >&6;} + fi + fi + XML_CPPFLAGS="" + XML_LIBS="" -ERROR! Clamdtop was configured, but not found. You need to install libncurses5-dev. -" "$LINENO" 5 -fi fi -cat >>confdefs.h <<_ACEOF -#define CURSES_INCLUDE $CURSES_INCLUDE -_ACEOF - if test "X$HAVE_LIBNCURSES" = "Xyes" || test "X$HAVE_LIBPDCURSES" = "Xyes"; then - HAVE_CURSES_TRUE= - HAVE_CURSES_FALSE='#' -else - HAVE_CURSES_TRUE='#' - HAVE_CURSES_FALSE= -fi -# Check whether --enable-distcheck-werror was given. -if test "${enable_distcheck_werror+set}" = set; then : - enableval=$enable_distcheck_werror; enable_distcheckwerror=$enableval -else - enable_distcheckwerror="no" -fi -# Enable distcheck warnings and Werror only for gcc versions that support them, -# and only after we've run the configure tests. -# Some configure tests fail (like checking for cos in -lm) if we enable these -# Werror flags for configure too (for example -Wstrict-prototypes makes -# configure think that -lm doesn't have cos, hence its in libc). -WERR_CFLAGS= -WERR_CFLAGS_MILTER= -if test "x$enable_distcheckwerror" = "xyes"; then - if test "$distcheck_enable_flags" = "1"; then - WERR_COMMON="-Wno-pointer-sign -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wno-error=strict-aliasing -Wno-error=bad-function-cast -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wno-error=type-limits -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=aggregate-return" - WERR_CFLAGS="$WERR_COMMON -Wwrite-strings" - WERR_CFLAGS_MILTER="$WERR_COMMON -Wno-error=format-nonliteral" - fi -fi -# Check whether --enable-llvm was given. -if test "${enable_llvm+set}" = set; then : - enableval=$enable_llvm; enable_llvm=$enableval -else - enable_llvm="auto" -fi -if test "$enable_llvm" != "no"; then -subdirs="$subdirs " -subdirfailed=no -subdirs="$subdirs libclamav/c++" -fi -# Check whether --enable-sha-collector-for-internal-use was given. -if test "${enable_sha_collector_for_internal_use+set}" = set; then : - enableval=$enable_sha_collector_for_internal_use; enable_sha_collector="yes" -else - enable_sha_collector="no" -fi -if test "$enable_sha_collector" != "no"; then -$as_echo "#define HAVE__INTERNAL__SHA_COLLECT 1" >>confdefs.h -fi + if test "$have_curl" = "yes"; then ENABLE_CLAMSUBMIT_TRUE= @@ -21183,7 +21785,8 @@ else fi -ac_config_files="$ac_config_files clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile clamsubmit/Makefile etc/Makefile test/Makefile unit_tests/Makefile clamdtop/Makefile clambc/Makefile Makefile clamav-config libclamav.pc platform.h docs/man/clamav-milter.8 docs/man/clamav-milter.conf.5 docs/man/clambc.1 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1 docs/man/clamdtop.1" +ac_config_files="$ac_config_files shared/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamsubmit/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile etc/Makefile test/Makefile unit_tests/Makefile clamdtop/Makefile clambc/Makefile Makefile clamav-config libclamav.pc platform.h docs/man/clamav-milter.8 docs/man/clamav-milter.conf.5 docs/man/clambc.1 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1 docs/man/clamdtop.1" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -21294,14 +21897,6 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21310,6 +21905,14 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -22250,16 +22853,17 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "libltdl/Makefile") CONFIG_FILES="$CONFIG_FILES libltdl/Makefile" ;; + "shared/Makefile") CONFIG_FILES="$CONFIG_FILES shared/Makefile" ;; "clamscan/Makefile") CONFIG_FILES="$CONFIG_FILES clamscan/Makefile" ;; "database/Makefile") CONFIG_FILES="$CONFIG_FILES database/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "clamd/Makefile") CONFIG_FILES="$CONFIG_FILES clamd/Makefile" ;; "clamdscan/Makefile") CONFIG_FILES="$CONFIG_FILES clamdscan/Makefile" ;; + "clamsubmit/Makefile") CONFIG_FILES="$CONFIG_FILES clamsubmit/Makefile" ;; "clamav-milter/Makefile") CONFIG_FILES="$CONFIG_FILES clamav-milter/Makefile" ;; "freshclam/Makefile") CONFIG_FILES="$CONFIG_FILES freshclam/Makefile" ;; "sigtool/Makefile") CONFIG_FILES="$CONFIG_FILES sigtool/Makefile" ;; "clamconf/Makefile") CONFIG_FILES="$CONFIG_FILES clamconf/Makefile" ;; - "clamsubmit/Makefile") CONFIG_FILES="$CONFIG_FILES clamsubmit/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "unit_tests/Makefile") CONFIG_FILES="$CONFIG_FILES unit_tests/Makefile" ;; @@ -23911,14 +24515,6 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -23927,6 +24523,14 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -24876,16 +25480,17 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "libltdl/Makefile") CONFIG_FILES="$CONFIG_FILES libltdl/Makefile" ;; + "shared/Makefile") CONFIG_FILES="$CONFIG_FILES shared/Makefile" ;; "clamscan/Makefile") CONFIG_FILES="$CONFIG_FILES clamscan/Makefile" ;; "database/Makefile") CONFIG_FILES="$CONFIG_FILES database/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "clamd/Makefile") CONFIG_FILES="$CONFIG_FILES clamd/Makefile" ;; "clamdscan/Makefile") CONFIG_FILES="$CONFIG_FILES clamdscan/Makefile" ;; + "clamsubmit/Makefile") CONFIG_FILES="$CONFIG_FILES clamsubmit/Makefile" ;; "clamav-milter/Makefile") CONFIG_FILES="$CONFIG_FILES clamav-milter/Makefile" ;; "freshclam/Makefile") CONFIG_FILES="$CONFIG_FILES freshclam/Makefile" ;; "sigtool/Makefile") CONFIG_FILES="$CONFIG_FILES sigtool/Makefile" ;; "clamconf/Makefile") CONFIG_FILES="$CONFIG_FILES clamconf/Makefile" ;; - "clamsubmit/Makefile") CONFIG_FILES="$CONFIG_FILES clamsubmit/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "unit_tests/Makefile") CONFIG_FILES="$CONFIG_FILES unit_tests/Makefile" ;; diff --git a/configure.ac b/configure.ac index 4c0b8ed36..1ce6fe94d 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,7 @@ dnl safety check, this used to be a parameter to AC_INIT AC_CONFIG_SRCDIR([clamscan/clamscan.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CREATE_TARGET_H([target.h]) +AC_USE_SYSTEM_EXTENSIONS dnl -Wall and -Werror here are NOT CFLAGS, they refer to automake warnings dnl enable stealth builds and psychedelic tests @@ -41,386 +42,23 @@ dnl we told automake to not define these, since we want to include dnl the date in the version AC_DEFINE([PACKAGE], PACKAGE_NAME, [Name of package]) -dnl change this on a release -VERSION="devel-`date +%Y%m%d`" -dnl VERSION="0.98" - -LC_CURRENT=7 -LC_REVISION=19 -LC_AGE=1 -LIBCLAMAV_VERSION="$LC_CURRENT":"$LC_REVISION":"$LC_AGE" -AC_SUBST([LIBCLAMAV_VERSION]) - -AC_PROG_AWK -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET +m4_include([m4/reorganization/version.m4]) LT_CONFIG_LTDL_DIR([libltdl]) LT_INIT([dlopen disable-static]) LTDL_INIT([recursive]) + +m4_include([m4/reorganization/build_tools.m4]) +m4_include([m4/reorganization/headers.m4]) + AC_CONFIG_FILES([libltdl/Makefile]) -major=`expr $LC_CURRENT - $LC_AGE` -AC_DEFINE_UNQUOTED([LIBCLAMAV_FULLVER], "$major.$LC_AGE.$LC_REVISION", - ["Full library version number"]) -AC_DEFINE_UNQUOTED([LIBCLAMAV_MAJORVER], $major, - ["Major library version number"]) AC_DEFINE([SCANBUFF], 131072, [scan buffer size]) AC_DEFINE([FILEBUFF], 8192, [file i/o buffer size]) -AC_LIB_MULTILIB_GUESS - -AC_HEADER_STDC -AC_C_RESTRICT -AC_C_CONST -AC_C_INLINE -AC_C_BIGENDIAN - -LT_LIB_M - -AC_ARG_ENABLE([gcc-vcheck], -[ --disable-gcc-vcheck do not check for buggy gcc version ], -gcc_check=$enableval, gcc_check="yes") - -msg_gcc_check="use --disable-gcc-vcheck to disable this check. Before reporting any bugs check with a supported version of gcc" -VERSION_SUFFIX= -dnl Check for gcc-4.1.0 -if test "$gcc_check" = "yes"; then - if test "x$ac_compiler_gnu" = "xyes"; then - AC_MSG_CHECKING([for a supported version of gcc]) - gcc_version=`${CC} -dumpversion` - case "${gcc_version}" in - 4.1.0*) - AC_MSG_RESULT([no (${gcc_version})]) - AC_MSG_ERROR([gcc 4.1.0 is known to incorrectly compile upx.c. Upgrade your compiler to at least 4.1.1/4.1.2)]) - ;; - *) - AC_MSG_RESULT([ok (${gcc_version})]) - ;; - esac - case "${gcc_version}" in - [[56789]].* | 4.[[3456789]].*) - # bb #1581 - temporarely add -fno-strict-aliasing so gcc 4.4.0 - # works correctly - CFLAGS="$CFLAGS -fno-strict-aliasing" - ;; - *) - ;; - esac - fi -else - CFLAGS="$CFLAGS -O0" - VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler" -fi - -# add distcheck warning flags -distcheck_enable_flags=0 -if test "x$ac_compiler_gnu" = "xyes"; then - gcc_version=`${CC} -dumpversion` - case "${gcc_version}" in - 4.[[3456789]]*) - distcheck_enable_flags=1 - ;; - [[56789]].*) - distcheck_enable_flags=1 - ;; - esac -fi - -dnl Checks if compiler produces valid code, regardless of compiler -dnl we do these checks here to avoid receiving endless bugreports about -dnl breakages due to compiler bugs. - -dnl Check if compiler produces invalid code on gcc PR27603 (affects upx.c) -dnl testcase from gcc testsuite -AC_MSG_CHECKING([for gcc bug PR27603]) -AC_TRY_RUN( - [ -/* (C) Richard Guenther */ -void exit (int); -void abort (void); -int a; -int main(void) -{ - int j; - for (j = 0; j < 6; j++) - { - if ((unsigned)j - 3 <= 1) - exit (0); - a = 1000 * (6 - j); - } - abort (); -} -], [AC_MSG_RESULT([ok, bug not present])], -[AC_MSG_ERROR([your compiler has gcc PR27603 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27603])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) - -dnl Check if compiler produces invalid code on gcc PR26763-2 (affects upx.c) -dnl testcase from gcc testsuite -AC_MSG_CHECKING([for gcc bug PR26763-2]) -AC_TRY_RUN( - [ -/* (C) Richard Guenther */ -extern void abort(void); - -static int try (char *a, int d) -{ - return a + d > a; -} - -int main(void) -{ - char bla[100]; - - if (try (bla + 50, -1)) - abort (); - - return 0; -} -], [AC_MSG_RESULT([ok, bug not present])], -[AC_MSG_ERROR([your compiler has gcc PR26763-2 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763])],[AC_MSG_RESULT([cross-compiling, assumed ok])]) - -dnl Check if compiler produces invalid code on own testcase based on upx.c -AC_MSG_CHECKING([for valid code generation of CLI_ISCONTAINED]) -AC_TRY_RUN( - [ -#include -static struct v{ - char* dst; - unsigned int dsize; - unsigned int dcur; - unsigned int backsize; - signed int unp_offset; -} values[] = { - {(char*)0xf78ab008, 0x2e000, 1, 4, -1594}, - {(char*)0xb7af1008, 0x2e000, 1, 4, -1594} - -}; -extern void abort(void); - -#define CLI_ISCONTAINED(bb, bb_size, sb, sb_size) \ - ((bb_size) > 0 && (sb_size) > 0 && (size_t)(sb_size) <= (size_t)(bb_size) \ - && (sb) >= (bb) && ((sb) + (sb_size)) <= ((bb) + (bb_size)) && ((sb) + (sb_size)) > (bb) && (sb) < ((bb) + (bb_size))) - -int crashtest() -{ - unsigned int backsize, dcur; - int dval=0x12000, unp_offset; - int* dsize = &dval; - char* dst = (char*)0x12000; - while(1) { - backsize=4; - dcur=0; - unp_offset=0x800002c7; - - if (!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || !CLI_ISCONTAINED(dst, *dsize, dst+dcur, backsize) || unp_offset >=0) - return -1; - abort(); - } - return 0; -} - -int main(void) -{ - int i; - for(i=0;idst; - unsigned int* dsize = &v->dsize; - unsigned int dcur = v->dcur; - unsigned int backsize = v->backsize-1; - signed int unp_offset = v->unp_offset; - - if(!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || - !CLI_ISCONTAINED(dst, *dsize,dst+dcur,backsize) || unp_offset >= 0) { - continue; - } - abort(); - } - crashtest(); - return 0; -} -], [AC_MSG_RESULT([ok, bug not present])], -[AC_MSG_ERROR([your compiler has a bug that causes clamav bug no. 670, use a different compiler, see http://bugs.clamav.net/bugzilla/show_bug.cgi?id=670])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) - -dnl Check if compiler produces invalid code on gcc PR28045 (affects upx.c) -dnl testcase from gcc testsuite -AC_MSG_CHECKING([for gcc bug PR28045]) -AC_TRY_RUN( - [ -/* (C) Andrew Pinski */ -extern void abort(void); -struct a -{ - unsigned int bits : 1; - signed long val : ((sizeof(long) * 8) - 1); -}; -static int Fnegate (struct a b) -{ - if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL)) - && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1)) - return 0 ; - abort (); -} -int main (void) -{ - struct a b = {1, 1}; - Fnegate (b); - return 0; -} -], [AC_MSG_RESULT([ok, bug not present])], -[AC_MSG_ERROR([your compiler has gcc PR28045 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28045])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) - -dnl Check if compiler produces invalid code on gcc PR37573 (affects autoit.c) -dnl this is a bug in gcc 4.4.0, but for some reason it affects gcc 4.1.2 too -dnl gcc 4.1.3 is OK. This bug occurs only at -O3. -AC_MSG_CHECKING([for gcc bug PR37573]) -AC_TRY_RUN( - [ -#include -#include -struct S -{ - unsigned int *a; - unsigned int b; - unsigned int c[624]; -}; -static unsigned char -foo (struct S *s) -{ - unsigned int r; - if (!--s->b) - { - unsigned int *c = s->c; - unsigned int i; - s->a = c; - for (i = 0; i < 227; i++) - c[i] = - ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ - ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397]; - for (; i < 623; i++) - c[i] = - ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ - ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i - 227]; - c[623] = - ((((c[623] ^ c[0]) & 0x7ffffffe) ^ c[623]) >> 1) ^ ((0 - (c[0] & 1)) & - 0x9908b0df) ^ c[i - - - 227]; - } - r = *(s->a++); - r ^= (r >> 11); - r ^= ((r & 0xff3a58ad) << 7); - r ^= ((r & 0xffffdf8c) << 15); - r ^= (r >> 18); - return (unsigned char) (r >> 1); -} - -void -bar (unsigned char *p, unsigned int q, unsigned int r) -{ - struct S s; - unsigned int i; - unsigned int *c = s.c; - *c = r; - for (i = 1; i < 624; i++) - c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]); - s.b = 1; - while (q--) - *p++ ^= foo (&s); -}; - -static unsigned char p[23] = { - 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49, - 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38 -}; - -static unsigned char q[23] = { - 0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43, - 0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c -}; - -int -main (void) -{ - unsigned int s; - s = 23; - bar (p, s, s + 0xa25e); - if (memcmp (p, q, s) != 0) - abort (); - return 0; -} - -], [AC_MSG_RESULT([ok, bug not present])], -[AC_MSG_ERROR([your compiler has gcc PR37573 bug, use a lower optimization level (-O1 or -O2), see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37573])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) - -dnl Linker feature checks -dnl check for version script support in the linker (GNU ld, or Solaris ld style) -AC_CACHE_CHECK([for ld --version-script], [ac_cv_ld_version_script], [dnl - cat > conftest.c < conftest.map <&AS_MESSAGE_LOG_FD]); - then - VERSIONSCRIPTFLAG=--version-script - ac_cv_ld_version_script=yes - else - dnl check for Solaris ld style linker version script - if AC_TRY_COMMAND([${CC-cc} $CFLAGS $pic_flag $LDFLAGS -shared - -o conftest.so conftest.c - -Wl,-M,conftest.map - 1>&AS_MESSAGE_LOG_FD]); - then - VERSIONSCRIPTFLAG=-M - ac_cv_ld_version_script=yes; - else - ac_cv_ld_version_script=no - fi - fi - rm -f conftest*]) -AC_SUBST([VERSIONSCRIPTFLAG]) -AM_CONDITIONAL([VERSIONSCRIPT], test "x$ac_cv_ld_version_script" = "xyes") - -# it is not fatal if gperf is missing -AM_MISSING_PROG(GPERF, gperf) -AC_SUBST(GPERF) - -AC_CHECK_HEADERS([stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h]) -AC_CHECK_HEADER([syslog.h],AC_DEFINE([USE_SYSLOG],1,[use syslog]),) - -AC_TYPE_OFF_T -AC_COMPILE_CHECK_SIZEOF([short]) -AC_COMPILE_CHECK_SIZEOF([int]) -AC_COMPILE_CHECK_SIZEOF([long]) -AC_COMPILE_CHECK_SIZEOF([long long]) -AC_COMPILE_CHECK_SIZEOF([void *]) - -AC_CHECK_FUNCS([sysctlbyname]) -AC_CHECK_FUNCS([getifaddrs]) -AC_CHECK_HEADER([fcntl.h], AC_DEFINE([HAVE_FCNTL_H],1,[Define to 1 if you have the header file])) -AC_CHECK_HEADER([pthread.h], AC_DEFINE([HAVE_PTHREAD_H],1,[Define to 1 if you have the header file])) -AC_CHECK_HEADER([net/if_dl.h], AC_DEFINE([HAVE_NET_IF_DL_H],1,[Define to 1 if you have the header file])) +m4_include([m4/reorganization/c_options.m4]) +m4_include([m4/reorganization/compiler_checks.m4]) +m4_include([m4/reorganization/linker_checks.m4]) AC_ARG_ENABLE([experimental], [ --enable-experimental enable experimental code], @@ -434,1351 +72,75 @@ fi build_configure_args=`echo "$ac_configure_args" | sed -e 's/[\"]//g'` AC_SUBST([BUILD_CONFIGURE_FLAGS], [$build_configure_args]) -AX_CHECK_UNAME_SYSCALL -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"]) -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")]) - -AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise]) -AC_FUNC_FSEEKO - -dnl Check if anon maps are available, check if we can determine the page size -AC_C_FUNC_MMAP_PRIVATE -AC_C_FUNC_PAGESIZE -AC_C_FUNC_MMAP_ANONYMOUS -AC_ARG_ENABLE([mempool],[ --disable-mempool disable memory pools], enable_mempool=$enableval, enable_mempool="yes") -have_mempool="no" -if test "$enable_mempool" = "yes"; then - if test "$ac_cv_c_mmap_private" != "yes"; then - AC_MSG_NOTICE([****** mempool support disabled (mmap not available or not usable)]) - else - if test "$ac_cv_c_can_get_pagesize" != "yes"; then - AC_MSG_NOTICE([****** mempool support disabled (pagesize cannot be determined)]) - else - if test "$ac_cv_c_mmap_anonymous" = "no"; then - AC_MSG_NOTICE([****** mempool support disabled (anonymous mmap not available)]) - else - AC_DEFINE([USE_MPOOL],1,[enable memory pools]) - have_mempool="yes" - fi - fi - fi -fi - -enable_check_ut=auto -enable_ut_install=no -AC_ARG_ENABLE(check, -[ --enable-check Enable 'check' unit tests (default=auto)], enable_check_ut=$enableval, enable_check_ut="auto" ) - -if test "$enable_check_ut" != "no" ; then - AC_LIB_FIND([check],[check.h], - AC_LANG_PROGRAM([#include ],[srunner_create(0)]), - [CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK"], - []) -fi -AC_SUBST([CHECK_CPPFLAGS]) -AC_SUBST([CHECK_LIBS]) -AM_CONDITIONAL([HAVE_LIBCHECK],test "X$HAVE_LIBCHECK" = "Xyes") - -if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then - AC_MSG_ERROR([ - -ERROR! Check was configured, but not found. Get it from http://check.sf.net/ -]) -fi - -AC_ARG_ENABLE(coverage, - AC_HELP_STRING([--enable-coverage], - [turn on test coverage - @<:@default=no@:>@]), -[enable_cov=$enableval],[enable_cov="no"]) - -if test "x$enable_coverage" = "xyes"; then - if test "x$CHECK_LIBS" = "x"; then - AC_MSG_ERROR([Coverage testing required, but unit tests not enabled!]) - fi - if test "x$ac_compiler_gnu" != "xyes"; then - AC_MSG_ERROR([coverage testing only works if gcc is used]) - fi - - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - LDFLAGS="$LDFLAGS -lgcov" - AC_CHECK_PROGS(GCOV, gcov, false) - AC_CHECK_PROGS(LCOV, lcov, false) - AC_CHECK_PROGS(GENHTML, genhtml, false) -fi - -AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_coverage" = "xyes") - -have_pthreads=no -AC_CHECK_HEADER([pthread.h],[have_pthreads=yes],) +m4_include([m4/reorganization/code_checks/functions.m4]) +m4_include([m4/reorganization/code_checks/mpool.m4]) +m4_include([m4/reorganization/code_checks/unit_tests.m4]) +m4_include([m4/reorganization/code_checks/coverage.m4]) AM_MAINTAINER_MODE -dnl Check for zlib -AC_MSG_CHECKING([for zlib installation]) -AC_ARG_WITH([zlib], -[ --with-zlib=DIR path to directory containing zlib library (default= - /usr/local or /usr if not found in /usr/local)], -[ -if test "$withval"; then - ZLIB_HOME="$withval" - AC_MSG_RESULT([using $ZLIB_HOME]) -fi -], [ -ZLIB_HOME=/usr/local -if test ! -f "$ZLIB_HOME/include/zlib.h" -then - ZLIB_HOME=/usr -fi -AC_MSG_RESULT([$ZLIB_HOME]) -]) - -CLAMDSCAN_LIBS="$FRESHCLAM_LIBS" - -AC_ARG_ENABLE([zlib-vcheck], -[ --disable-zlib-vcheck do not check for buggy zlib version ], -zlib_check=$enableval, zlib_check="yes") - -if test ! -f "$ZLIB_HOME/include/zlib.h" -then - AC_MSG_ERROR([Please install zlib and zlib-devel packages]) -else - - vuln=`grep "ZLIB_VERSION \"1.2.0" $ZLIB_HOME/include/zlib.h` - if test -z "$vuln"; then - vuln=`grep "ZLIB_VERSION \"1.2.1" $ZLIB_HOME/include/zlib.h` - fi - - if test -n "$vuln"; then - if test "$zlib_check" = "yes"; then - AC_MSG_ERROR(The installed zlib version may contain a security bug. Please upgrade to 1.2.2 or later: http://www.zlib.net. You can omit this check with --disable-zlib-vcheck but DO NOT REPORT any stability issues then!) - else - AC_MSG_WARN([****** This ClamAV installation may be linked against]) - AC_MSG_WARN([****** a broken zlib version. Please DO NOT report any]) - AC_MSG_WARN([****** stability problems to the ClamAV developers!]) - fi - fi - - save_LIBS="$LIBS" - if test "$ZLIB_HOME" != "/usr"; then - CPPFLAGS="$CPPFLAGS -I$ZLIB_HOME/include" - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$ZLIB_HOME/lib" - AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$ZLIB_HOME/lib -lz"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$ZLIB_HOME/lib -lz"], AC_MSG_ERROR([Please install zlib and zlib-devel packages])) - AC_CHECK_LIB([z], [gzopen], [], AC_MSG_ERROR([Your zlib is missing gzopen()])) - LDFLAGS="$save_LDFLAGS" - else - AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz";FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lz"], AC_MSG_ERROR([Please install zlib and zlib-devel packages])) - AC_CHECK_LIB([z], [gzopen],[], AC_MSG_ERROR([Your zlib is missing gzopen()])) - fi - LIBS="$save_LIBS" -fi - -AC_ARG_ENABLE([bzip2], -[ --disable-bzip2 disable bzip2 support], -want_bzip2=$enableval, want_bzip2="yes") - -bzip_check="ok" -if test "$want_bzip2" = "yes" -then - AC_LIB_LINKFLAGS([bz2]) - save_LDFLAGS="$LDFLAGS" - # Only add -L if prefix is not empty - test -z "$LIBBZ2_PREFIX" || LDFLAGS="$LDFLAGS -L$LIBBZ2_PREFIX/$acl_libdirstem"; - - have_bzprefix="no" - AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [have_bzprefix="yes"]) - if test "x$have_bzprefix" = "xno"; then - AC_DEFINE([NOBZ2PREFIX],1,[bzip funtions do not have bz2 prefix]) - fi - LDFLAGS="$save_LDFLAGS" - if test "$HAVE_LIBBZ2" = "yes"; then - AC_CHECK_HEADER([bzlib.h], - [AC_C_CVE_2008_1372], - [ac_cv_c_cve_2008_1372="no"]) - if test "$ac_cv_c_cve_2008_1372" = "bugged"; then - AC_MSG_WARN([****** bzip2 libraries are affected by the CVE-2008-1372 bug]) - AC_MSG_WARN([****** We strongly suggest you to update to bzip2 1.0.5.]) - AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) - bzip_check="bugged (CVE-2008-1372)" - fi - if test "$ac_cv_c_cve_2008_1372" = "linkfailed"; then - dnl This shouldn't happen - dnl We failed to link but libtool may still be able to link, so don't disable bzip2 just yet - AC_MSG_WARN([****** Unable to link bzip2 testcase]) - AC_MSG_WARN([****** You may be affected by CVE-2008-1372 bug, but I need to be able to link a testcase to verify]) - AC_MSG_WARN([****** It is recommended to fix your build environment so that we can run the testcase!]) - AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) - bzip_check="link failed (CVE-2008-1372)" - fi - - case "$ac_cv_c_cve_2008_1372" in - ok|bugged|linkfailed) - ;; - *) - HAVE_LIBBZ2=no - ;; - esac - fi - - if test "$HAVE_LIBBZ2" = "yes"; then - AC_C_CVE_2010_0405 - if test "$ac_cv_c_cve_2010_0405" = "bugged"; then - AC_MSG_WARN([****** bzip2 libraries are affected by the CVE-2010-0405 bug]) - AC_MSG_WARN([****** We strongly suggest you to update bzip2]) - AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) - bzip_check="bugged (CVE-2010-0405)" - fi - if test "$ac_cv_c_cve_2010_0405" = "linkfailed"; then - dnl This shouldn't happen - dnl We failed to link but libtool may still be able to link, so don't disable bzip2 just yet - AC_MSG_WARN([****** Unable to link bzip2 testcase]) - AC_MSG_WARN([****** You may be affected by CVE-2010-0405 bug, but I need to be able to link a testcase to verify]) - AC_MSG_WARN([****** It is recommended to fix your build environment so that we can run the testcase!]) - AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) - bzip_check="link failed (CVE-2010-0405)" - fi - - case "$ac_cv_c_cve_2010_0405" in - ok|bugged|linkfailed) - LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS $LTLIBBZ2" - AC_DEFINE([HAVE_BZLIB_H],1,[have bzip2]) - ;; - *) - AC_MSG_WARN([****** bzip2 support disabled]) - ;; - esac - - else - AC_MSG_WARN([****** bzip2 support disabled]) - fi -fi - -have_curl="no" -curl_msg="Please use the web interface for submitting FPs/FNs." -AC_MSG_CHECKING([for libcurl installation]) - -AC_ARG_WITH([libcurl], -[ --with-libcurl=DIR path to directory containing libcurl (default= - /usr/local or /usr if not found in /usr/local)], -[ -if test "$withval"; then - LIBCURL_HOME="$withval" -fi -], [ -LIBCURL_HOME=/usr/local -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - LIBCURL_HOME=/usr -fi -AC_MSG_RESULT([$LIBCURL_HOME]) -]) - -if test ! -f "$LIBCURL_HOME/include/curl/curl.h" -then - AC_MSG_WARN([libcurl not found. Please use the web interface for submitting FPs/FNs.]) -else - if test -f "$LIBCURL_HOME/bin/curl-config"; then - CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs) - CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags) - else - CURL_LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" - CURL_CPPFLAGS="-I$LIBCURL_HOME/include" - fi - - save_LDFLAGS="$LDFLAGS" - LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" - AC_CHECK_LIB([curl], [curl_easy_init], [curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS"], - [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])]) -fi - -AM_CONDITIONAL([HAVE_LIBBZ2], test "x$HAVE_LIBBZ2" = "xyes") - -AC_ARG_ENABLE([unrar], -[ --disable-unrar do not build libclamunrar and libclamunrar_iface ], -want_unrar=$enableval, want_unrar="yes") -AM_CONDITIONAL([ENABLE_UNRAR],[test "$want_unrar" = "yes"]) - -dnl libxml2 -want_xml="auto" -AC_ARG_ENABLE([xml], -[ --disable-xml disable DMG and XAR support], -want_xml=$enableval, want_xml="auto") - -XML_HOME="" -if test "X$want_xml" != "Xno"; then - AC_MSG_CHECKING([for libxml2 installation]) - AC_ARG_WITH([xml], - [ --with-xml=DIR path to directory containing libxml2 library (default= - /usr/local or /usr if not found in /usr/local)], - [ - if test "$withval" - then - XML_HOME="$withval" - AC_MSG_RESULT([using $XML_HOME]) - else - AC_MSG_ERROR([cannot assign blank value to --with-xml]) - fi - ], [ - XML_HOME=/usr/local - if test ! -x "$XML_HOME/bin/xml2-config" - then - XML_HOME=/usr - if test ! -x "$XML_HOME/bin/xml2-config" - then - XML_HOME="" - fi - fi - if test "x$XML_HOME" != "x"; then - AC_MSG_RESULT([$XML_HOME]) - else - AC_MSG_RESULT([not found]) - fi - ]) -fi - -found_xml="no" -XMLCONF_VERSION="" -XML_CPPFLAGS="" -XML_LIBS="" -if test "x$XML_HOME" != "x"; then - AC_MSG_CHECKING([xml2-config version]) - XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`" - if test "x%XMLCONF_VERSION" != "x"; then - AC_MSG_RESULT([$XMLCONF_VERSION]) - found_xml="yes" - XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`" - XML_LIBS="`$XML_HOME/bin/xml2-config --libs`" - else - AC_MSG_ERROR([xml2-config failed]) - fi -fi - -working_xml="no" -if test "X$found_xml" != "Xno"; then - AC_MSG_CHECKING([for xmlreader.h in $XML_HOME]) - - if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then - AC_MSG_RESULT([not found]) - else - AC_MSG_RESULT([found]) - save_LIBS="$LIBS" - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $XML_LIBS" - - AC_CHECK_LIB([xml2], [xmlTextReaderRead], [working_xml="yes"], [working_xml="no"]) - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - fi -fi - -if test "$working_xml" = "yes"; then - AC_DEFINE([HAVE_LIBXML2],1,[Define to 1 if you have the 'libxml2' library (-lxml2).]) - AC_SUBST(XML_CPPFLAGS) - AC_SUBST(XML_LIBS) - AC_MSG_NOTICE([Compiling and linking with libxml2 from $XML_HOME]) -else - if test "$want_xml" = "yes"; then - AC_MSG_ERROR([****** Please install libxml2 packages!]) - else - if test "$want_xml" != "no"; then - AC_MSG_NOTICE([****** libxml2 support unavailable]) - fi - fi - XML_CPPFLAGS="" - XML_LIBS="" - AC_SUBST(XML_CPPFLAGS) - AC_SUBST(XML_LIBS) -fi - -AC_ARG_ENABLE([getaddrinfo], -[ --disable-getaddrinfo disable support for getaddrinfo], -want_getaddrinfo=$enableval, want_getaddrinfo="yes") - -if test "$want_getaddrinfo" = "yes" -then - AC_MSG_CHECKING([for getaddrinfo]) - AC_CACHE_VAL([have_cv_gai],[ - AC_TRY_RUN([ - #include - #include - #include - #include - int main(int argc, char **argv) - { - struct addrinfo *res; - int sd; - - if(getaddrinfo("127.0.0.1", NULL, NULL, &res) < 0) - return 1; - freeaddrinfo(res); - - return 0; - } - ], - [have_cv_gai=yes], - [have_cv_gai=no], - [have_cv_gai=no]) - ]) - AC_MSG_RESULT([$have_cv_gai]) - if test "$have_cv_gai" = yes; then - AC_DEFINE(HAVE_GETADDRINFO, 1, [have getaddrinfo()]) - fi -fi - -AC_ARG_ENABLE([ipv6], -[ --disable-ipv6 disable IPv6 support], -want_ipv6=$enableval, want_ipv6="yes") - -if test "$want_ipv6" = "yes" -then - AC_MSG_CHECKING([for IPv6 support]) - AC_CACHE_VAL([have_cv_ipv6],[ - AC_TRY_RUN([ - #include - #include - #include - #include - int main(int argc, char **argv) - { - struct addrinfo *res, hints; - int sd; - - if((sd = socket(AF_INET6, SOCK_STREAM, 0)) < 0) - return 1; - close(sd); - /* also check if getaddrinfo() handles AF_UNSPEC -- bb#1196 */ - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; - if(getaddrinfo("127.0.0.1", NULL, &hints, &res) < 0) - return 1; - freeaddrinfo(res); - return 0; - } - ], - [have_cv_ipv6=yes], - [have_cv_ipv6=no], - [have_cv_ipv6=no]) - ]) - AC_MSG_RESULT([$have_cv_ipv6]) - if test "$have_cv_ipv6" = yes; then - AC_DEFINE(SUPPORT_IPv6, 1, [Support for IPv6]) - fi -fi - -AC_C_DNS - -AC_ARG_ENABLE([fanotify], -[ --disable-fanotify disable fanotify support (Linux only)], -want_fanotify=$enableval, want_fanotify="yes") - -dnl AC_FUNC_SETPGRP does not work when cross compiling -dnl Instead, assume we will have a prototype for setpgrp if cross compiling. -dnl testcase from gdb/configure.ac -if test "$cross_compiling" = no; then - AC_FUNC_SETPGRP -else - AC_CACHE_CHECK([whether setpgrp takes no argument], [ac_cv_func_setpgrp_void], - [AC_TRY_COMPILE([ -#include -], [ - if (setpgrp(1,1) == -1) - exit (0); - else - exit (1); -], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)]) -if test $ac_cv_func_setpgrp_void = yes; then - AC_DEFINE([SETPGRP_VOID], 1) -fi -fi - -AC_ARG_ENABLE([milter], -[ --enable-milter build clamav-milter], -have_milter=$enableval, have_milter="no") - -dnl we need to try to link with iconv, otherwise there could be a -dnl mismatch between a 32-bit and 64-bit lib. Detect this at configure time. -dnl we need to check after zlib/bzip2, because they can change the include path -AC_ARG_WITH([iconv], [ --with-iconv supports iconv() (default=auto)], -[ - case "$withval" in - yes|no) wiconv="$withval";; - *) AC_MSG_ERROR([--with-iconv does not take an argument]);; - esac], -[ wiconv=auto ]) -if test "X$wiconv" != "Xno"; then - AC_CHECK_LIB([iconv], [libiconv_open], LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -liconv") - AC_MSG_CHECKING([for iconv]) - save_LIBS="$LIBS" - LIBS="$LIBCLAMAV_LIBS" - AC_TRY_LINK([ - #include - ],[ - char** xin,**xout; - unsigned long il,ol; - int rc; - iconv_t iconv_struct = iconv_open("UTF-16BE","UTF-8"); - rc = iconv(iconv_struct,xin,&il,xout,&ol); - iconv_close(iconv_struct); -],[ - AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_ICONV], 1, [iconv() available]) -],[ - AC_MSG_RESULT(no) -]) - LIBS="$save_LIBS" -fi - -AC_ARG_ENABLE([pthreads], -[ --disable-pthreads disable POSIX threads support], -have_pthreads=$enableval,) - -AC_ARG_ENABLE([cr], -[ --disable-cr do not link with C reentrant library (BSD) ], -use_cr=$enableval,) - -AC_ARG_ENABLE([id-check], -[ --enable-id-check use id utility instead of /etc/passwd parsing], -use_id=$enableval, use_id="no") - -AC_ARG_ENABLE([yp-check], -[ --enable-yp-check use ypmatch utility instead of /etc/passwd parsing], -use_yp=$enableval, use_yp="no") - -AC_ARG_WITH([user], -[ --with-user=uid name of the clamav user (default=clamav)], -clamav_user="$withval", clamav_user="clamav") - -AC_ARG_WITH([group], -[ --with-group=gid name of the clamav group (default=clamav)], -clamav_group="$withval", clamav_group="clamav") - -AC_DEFINE_UNQUOTED([CLAMAVUSER],"$clamav_user",[name of the clamav user]) -AC_DEFINE_UNQUOTED([CLAMAVGROUP],"$clamav_group",[name of the clamav group]) - -AC_ARG_ENABLE([clamav], -[ --disable-clamav disable test for clamav user/group], -test_clamav=$enableval, test_clamav=yes) - -AC_ARG_ENABLE([debug], -[ --enable-debug enable debug code], -enable_debug=$enableval, enable_debug="no") - -if test "$enable_debug" = "yes"; then - VERSION_SUFFIX="$VERSION_SUFFIX-debug" - AC_DEFINE([CL_DEBUG],1,[enable debugging]) -else - AC_DEFINE([NDEBUG],1,[disable assertions]) -fi - -AC_ARG_WITH([version], -[ --with-version=STR use custom version string (dev only)], -VERSION="$withval", ) - -AC_ARG_ENABLE([no-cache], -[ --enable-no-cache use "Cache-Control: no-cache" in freshclam], -enable_nocache=$enableval, enable_nocache="no") - -if test "$enable_nocache" = "yes"; then - AC_DEFINE([FRESHCLAM_NO_CACHE],1,[use "Cache-Control: no-cache" in freshclam]) -fi - -AC_ARG_ENABLE([dns-fix], -[ --enable-dns-fix enable workaround for broken DNS servers (as in SpeedTouch 510)], -enable_dnsfix=$enableval, enable_dnsfix="no") - -if test "$enable_dnsfix" = "yes"; then - AC_DEFINE([FRESHCLAM_DNS_FIX],1,[enable workaround for broken DNS servers]) -fi - -AC_ARG_ENABLE([bigstack], -[ --enable-bigstack increase thread stack size], -enable_bigstack=$enableval, enable_bigstack="no") - -if test "$enable_bigstack" = "yes"; then - AC_DEFINE([C_BIGSTACK],1,[Increase thread stack size.]) -fi - -AC_ARG_WITH([dbdir], -[ --with-dbdir=path path to virus database directory], -db_dir="$withval", db_dir="_default_") - -dnl I had problems with $pkgdatadir thus these funny checks -if test "$db_dir" = "_default_" -then - if test "$prefix" = "NONE" - then - db_dir="$ac_default_prefix/share/clamav" - else - db_dir="$prefix/share/clamav" - fi -fi - -AC_DEFINE_UNQUOTED([DATADIR],"$db_dir", [Path to virus database directory.]) -DBDIR="$db_dir" -AC_SUBST([DBDIR]) - -dnl configure config directory -cfg_dir=`echo $sysconfdir | grep prefix` - -if test -n "$cfg_dir"; then - if test "$prefix" = "NONE" - then - cfg_dir="$ac_default_prefix/etc" - else - cfg_dir="$prefix/etc" - fi -else - cfg_dir="$sysconfdir" -fi - -CFGDIR=$cfg_dir -AC_SUBST([CFGDIR]) -AC_DEFINE_UNQUOTED([CONFDIR],"$cfg_dir",[where to look for the config file]) - -dnl check for in_port_t definition -AC_MSG_CHECKING([whether in_port_t is defined]) -AC_TRY_COMPILE([ -#include -#include -], -[in_port_t pt; pt = 0; return pt;], -[ - AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_IN_PORT_T],1,[in_port_t is defined]) -], -AC_MSG_RESULT(no)) - -dnl check for in_addr_t definition -AC_MSG_CHECKING([for in_addr_t definition]) -AC_TRY_COMPILE([ -#include -#include -], -[ in_addr_t pt; pt = 0; return pt; ], -[ - AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_IN_ADDR_T],1,[in_addr_t is defined]) -], -AC_MSG_RESULT(no)) - -case "$target_os" in -linux*) - AC_DEFINE([C_LINUX],1,[target is linux]) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - if test "$want_fanotify" = "yes"; then - AC_CHECK_HEADER([linux/fanotify.h],AC_DEFINE([FANOTIFY],1,[use fanotify]),) - fi - fi - ;; -kfreebsd*-gnu) - AC_DEFINE([C_KFREEBSD_GNU],1,[target is kfreebsd-gnu]) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - ;; -solaris*) - CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lresolv" - FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv" - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - CLAMD_LIBS="$CLAMD_LIBS -lresolv" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lresolv" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_SOLARIS],1,[os is solaris]) - ;; -freebsd[[45]]*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread -lc_r" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_BSD],1,[os is freebsd 4 or 5]) - ;; -freebsd*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lthr" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_BSD],1,[os is freebsd 6]) - ;; -dragonfly*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_BSD],1,[os is dragonfly]) - ;; -openbsd*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - CLAMD_LIBS="$CLAMD_LIBS -pthread" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_BSD],1,[os is OpenBSD]) - ;; -bsdi*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_BSD],1,[os is BSDI BSD/OS]) - ;; -netbsd*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - fi - AC_DEFINE([C_BSD],1,[os is NetBSD]) - ;; -bsd*) - AC_MSG_RESULT([Unknown BSD detected. Disabling thread support.]) - have_pthreads="no" - AC_DEFINE([C_BSD],1,[os is bsd flavor]) - ;; -beos*) - AC_MSG_RESULT([BeOS detected. Disabling thread support.]) - have_pthreads="no" - AC_DEFINE([C_BEOS],1,[os is beos]) - ;; -x86:Interix*) - AC_DEFINE([C_INTERIX],1,[os is Interix]) - ;; -darwin*) - AC_DEFINE([C_BSD],1,[os is bsd flavor]) - AC_DEFINE([C_DARWIN],1,[os is darwin]) - AC_DEFINE([BIND_8_COMPAT],1,[enable bind8 compatibility]) - AC_DEFINE([CLAMAUTH],1,[use ClamAuth]) - use_netinfo="yes" - ;; -os2*) - CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lsyslog" - FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsyslog" - CLAMD_LIBS="$CLAMD_LIBS -lsyslog" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsyslog" - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_OS2],1,[os is OS/2]) - ;; -sco*) - dnl njh@bandsman.sco.uk: SCO Unix port - dnl FRESHCLAM_LIBS="-lsocket" - dnl CLAMD_LIBS="-lsocket" - dnl CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket" - ;; -hpux*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - AC_DEFINE([C_HPUX],1,[os is hpux]) - if test "$have_mempool" = "yes"; then - LDFLAGS="$LDFLAGS -Wl,+pd,1M" - fi - ;; -aix*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - AC_DEFINE([_THREAD_SAFE],1,[thread safe]) - fi - AC_DEFINE([C_AIX],1,[os is aix]) - ;; -*-*-osf*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-pthread" - TH_SAFE="-thread-safe" - AC_DEFINE([_POSIX_PII_SOCKET],1,[POSIX compatibility]) - fi - AC_DEFINE([C_OSF],1,[os is osf/tru64]) - ;; -nto-qnx*) - AC_DEFINE([C_QNX6],1,[os is QNX 6.x.x]) - ;; -irix*) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - LIBS="$LIBS -lgen" - AC_DEFINE([C_IRIX],1,[os is irix]) - ;; -interix*) - AC_DEFINE([C_INTERIX],1,[os is interix]) - if test "$test_clamav" = "yes"; then - if test ! -r /etc/passwd; then - test_clamav="no" - fi - fi - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - ;; -gnu*) - AC_DEFINE([C_GNU_HURD],1,[target is gnu-hurd]) - if test "$have_pthreads" = "yes"; then - THREAD_LIBS="-lpthread" - TH_SAFE="-thread-safe" - fi - ;; -*) - ;; -esac - -AC_SUBST([LIBCLAMAV_LIBS]) -AC_SUBST([CLAMD_LIBS]) -AC_SUBST([CLAMAV_MILTER_LIBS]) -AC_SUBST([FRESHCLAM_LIBS]) -AC_SUBST([CLAMDSCAN_LIBS]) -AC_SUBST([TH_SAFE]) -AC_SUBST([THREAD_LIBS]) -AC_SUBST([CLAMSUBMIT_LIBS]) -AC_SUBST([CLAMSUBMIT_CFLAGS]) - -dnl --enable-milter -if test "$have_milter" = "yes"; then - dnl libmilter checking code adapted from spamass-milter by - dnl Tom G. Christensen - - dnl Check for libmilter and it's header files in the usual locations - save_LIBS="$LIBS" - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" - if test -d /usr/lib/libmilter ; then - CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter" - fi - LIBS="$LIBS -lmilter $CLAMAV_MILTER_LIBS" - AC_CHECK_LIB([milter],[mi_stop],[CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_LIBS"],[ - dnl Older sendmails require libsm or libsmutil for support functions - AC_SEARCH_LIBS([strlcpy], [sm smutil], [test "$ac_cv_search_strlcpy" = "none required" || CLAMAV_MILTER_XLIB="$ac_cv_search_strlcpy"]) - LIBS="$save_LIBS $CLAMAV_MILTER_LIBS $CLAMAV_MILTER_XLIB" - $as_unset ac_cv_lib_milter_mi_stop - AC_CHECK_LIB([milter],[mi_stop],[CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_XLIB $CLAMAV_MILTER_LIBS"],[ - AC_MSG_ERROR([Cannot find libmilter]) - ]) - ]) - LIBS="$save_LIBS" - AC_CHECK_HEADERS([libmilter/mfapi.h],[have_milter="yes"],[ - AC_MSG_ERROR([Please install mfapi.h from the sendmail distribution]) - ]) -fi - -AM_CONDITIONAL([BUILD_CLAMD],[test "$have_pthreads" = "yes"]) -AM_CONDITIONAL([HAVE_MILTER],[test "$have_milter" = "yes"]) - -if test "$have_pthreads" = "yes" -then - save_LIBS="$LIBS" - LIBS="$THREAD_LIBS $LIBS" - AC_CHECK_FUNCS([sched_yield pthread_yield]) - LIBS="$save_LIBS" - AC_DEFINE([BUILD_CLAMD], 1, "build clamd") - dnl define these here, so we don't forget any system - AC_DEFINE([CL_THREAD_SAFE],1,[thread safe]) - AC_DEFINE([_REENTRANT],1,[thread safe]) -fi - -AC_CHECK_FUNCS([enable_extended_FILE_stdio]) - -dnl Check for readdir_r and number of its arguments -dnl Code from libwww/configure.in - -AC_MSG_CHECKING([for readdir_r]) -if test -z "$ac_cv_readdir_args"; then - AC_TRY_COMPILE( - [ -#include -#include - ], - [ - struct dirent dir, *dirp; - DIR *mydir; - dirp = readdir_r(mydir, &dir); - ], ac_cv_readdir_args=2) -fi -if test -z "$ac_cv_readdir_args"; then - AC_TRY_COMPILE( - [ -#include -#include - ], - [ - struct dirent dir, *dirp; - DIR *mydir; - int rc; - rc = readdir_r(mydir, &dir, &dirp); - ], ac_cv_readdir_args=3) -fi - -AC_ARG_ENABLE([readdir_r], -[ --enable-readdir_r enable support for readdir_r], -enable_readdir_r=$enableval, enable_readdir_r="no") - -if test "$enable_readdir_r" = "no"; then - AC_MSG_RESULT(support disabled) -elif test -z "$ac_cv_readdir_args"; then - AC_MSG_RESULT(no) -else - if test "$ac_cv_readdir_args" = 2; then - AC_DEFINE([HAVE_READDIR_R_2],1,[readdir_r takes 2 arguments]) - elif test "$ac_cv_readdir_args" = 3; then - AC_DEFINE([HAVE_READDIR_R_3],1,[readdir_r takes 3 arguments]) - fi - AC_MSG_RESULT([yes, and it takes $ac_cv_readdir_args arguments]) -fi - -AC_MSG_CHECKING([for ctime_r]) -if test "$ac_cv_func_ctime_r" = "yes"; then - AC_TRY_COMPILE([ - #include - ],[ - char buf[31]; - time_t t; - ctime_r(&t, buf, 30); - ],[ - ac_cv_ctime_args=3 - AC_DEFINE([HAVE_CTIME_R_3],1,[ctime_r takes 3 arguments]) - ],[ - ac_cv_ctime_args=2 - AC_DEFINE([HAVE_CTIME_R_2],1,[ctime_r takes 2 arguments]) - ]) - - AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments]) -fi - -dnl Determine socklen_t type. Code from lftp. -AC_MSG_CHECKING([for socklen_t]) -AC_CACHE_VAL([ac_cv_socklen_t], -[ - ac_cv_socklen_t=no - AC_TRY_COMPILE([ - #include - #include - ], - [ - socklen_t len; - getpeername(0,0,&len); - ], - [ - ac_cv_socklen_t=yes - ]) -]) -AC_MSG_RESULT([$ac_cv_socklen_t]) - if test $ac_cv_socklen_t = no; then - AC_MSG_CHECKING([for socklen_t equivalent]) - AC_CACHE_VAL([ac_cv_socklen_t_equiv], - [ - ac_cv_socklen_t_equiv=int - for t in int size_t unsigned long "unsigned long"; do - AC_TRY_COMPILE([ - #include - #include - ], - [ - $t len; - getpeername(0,0,&len); - ], - [ - ac_cv_socklen_t_equiv="$t" - break - ]) - done - ]) - AC_MSG_RESULT([$ac_cv_socklen_t_equiv]) - AC_DEFINE_UNQUOTED([socklen_t], $ac_cv_socklen_t_equiv, [Define to "int" if does not define.]) -fi - -dnl Check for clamav in /etc/passwd -if test "$test_clamav" = "yes" -then - dnl parse /etc/passwd - if test "$use_id" = "no" - then - AC_MSG_CHECKING([for $clamav_user in /etc/passwd]) - if test -r /etc/passwd; then - clamavuser=`cat /etc/passwd|grep "^$clamav_user:"` - clamavgroup=`cat /etc/group|grep "^$clamav_group:"` - fi - else - AC_MSG_CHECKING([for $clamav_user using id]) - id $clamav_user > /dev/null 2>&1 - if test "$?" = 0 ; then - clamavuser=1 - AC_PATH_PROG(GETENT, getent) - if test -n "$GETENT" ; then - clamavgroup=`$GETENT group | grep "^${clamav_group}:"` - else - clamavgroup=`cat /etc/group|grep $clamav_group` - fi - fi - fi - - if test "$use_netinfo" = "yes" - then - if test -x /usr/bin/dscl; then - AC_MSG_CHECKING([for $clamav_user using dscl]) - clamavuser=`/usr/bin/dscl . -list /Users |grep ${clamav_user}` - clamavgroup=`/usr/bin/dscl . -list /Groups |grep ${clamav_group}` - else - AC_MSG_CHECKING([for $clamav_user using netinfo]) - clamavuser=`/usr/bin/nidump passwd . |grep ${clamav_user}` - clamavgroup=`/usr/bin/nidump group . |grep ${clamav_group}` - fi - fi - - if test "$use_yp" = "yes" - then - AC_MSG_CHECKING([for $clamav_user using ypmatch]) - clamavuser=`ypmatch ${clamav_user} passwd` - clamavgroup=`ypmatch ${clamav_group} group` - fi - - if test -z "$clamavuser" || test -z "$clamavgroup" - then - AC_MSG_RESULT(no) - AC_MSG_ERROR([User $clamav_user (and/or group $clamav_group) does not exist. Please read the documentation !]) - else - AC_MSG_RESULT([yes, user $clamav_user and group $clamav_group]) - CLAMAVUSER="$clamav_user" - CLAMAVGROUP="$clamav_group" - AC_SUBST([CLAMAVUSER]) - AC_SUBST([CLAMAVGROUP]) - fi -fi - -dnl check for __attribute__((packed)) -dnl but only on compilers claiming to be gcc compatible -dnl because for example Sun's compiler silently ignores the packed attribute. -AC_MSG_CHECKING([for structure packing via __attribute__((packed))]) -AC_CACHE_VAL([have_cv_attrib_packed],[ - AC_TRY_COMPILE(, - [#ifdef __GNUC__ - struct { int i __attribute__((packed)); } s; - #else - #error Only checking for packed attribute on gcc-like compilers - #endif], - [have_cv_attrib_packed=yes], - [have_cv_attrib_packed=no]) - ]) -AC_MSG_RESULT([$have_cv_attrib_packed]) - -if test "$have_cv_attrib_packed" = no; then - AC_MSG_CHECKING([for structure packing via pragma]) - AC_CACHE_VAL([have_cv_pragma_pack],[ - AC_TRY_RUN([ - int main(int argc, char **argv) { -#pragma pack(1) /* has to be in column 1 ! */ - struct { char c; long l; } s; - return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ], - [have_cv_pragma_pack=yes], - [have_cv_pragma_pack=no]) - ]) - AC_MSG_RESULT([$have_cv_pragma_pack]) - if test "$have_cv_pragma_pack" = yes; then - AC_DEFINE([HAVE_PRAGMA_PACK], 1, "pragma pack") - else - AC_MSG_CHECKING([for structure packing via hppa/hp-ux pragma]) - AC_CACHE_VAL([have_cv_pragma_pack_hpux],[ - AC_TRY_RUN([ - /* hppa/hp-ux wants pragma outside of function */ -#pragma pack 1 /* has to be in column 1 ! */ - struct { char c; long l; } s; - int main(int argc, char **argv) { - return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ], - [have_cv_pragma_pack_hpux=yes], - [have_cv_pragma_pack_hpux=no]) - ]) - AC_MSG_RESULT([$have_cv_pragma_pack_hpux]) - AC_DEFINE([HAVE_PRAGMA_PACK_HPPA], 1, "pragma pack hppa/hp-ux style") - fi -fi - -dnl check for __attribute__((aligned)) -AC_MSG_CHECKING([for type aligning via __attribute__((aligned))]) -AC_CACHE_VAL([have_cv_attrib_aligned],[ - AC_TRY_COMPILE(, - [typedef int cl_aligned_int __attribute__((aligned));], - [have_cv_attrib_aligned=yes], - [have_cv_attrib_aligned=no]) - ]) -AC_MSG_RESULT([$have_cv_attrib_aligned]) - -if test "$have_cv_attrib_packed" = no -a "$have_cv_pragma_pack" = no -a "$have_cv_pragma_pack_hpux" = no; then - AC_MSG_ERROR(Need to know how to pack structures with this compiler) -fi - -if test "$have_cv_attrib_packed" = yes; then - AC_DEFINE([HAVE_ATTRIB_PACKED], 1, [attrib packed]) -fi - -if test "$have_cv_attrib_aligned" = yes; then - AC_DEFINE([HAVE_ATTRIB_ALIGNED], 1, [attrib aligned]) -fi - -dnl Sanity check that struct packing works -AC_MSG_CHECKING([that structure packing works]) -AC_CACHE_VAL([have_cv_struct_pack],[ - AC_TRY_RUN([ -#ifndef HAVE_ATTRIB_PACKED -#define __attribute__(x) -#endif -#ifdef HAVE_PRAGMA_PACK -#pragma pack(1) /* has to be in column 1 ! */ -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack 1 /* has to be in column 1 ! */ -#endif - -struct { char c __attribute__((packed)); long l __attribute__((packed)); } s; - -#ifdef HAVE_PRAGMA_PACK -#pragma pack() -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack -#endif - -struct { char c; long l;} s2; - -#ifdef HAVE_PRAGMA_PACK -#pragma pack(1) /* has to be in column 1 ! */ -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack 1 /* has to be in column 1 ! */ -#endif - -struct { char c; long l; } __attribute__((packed)) s3; - -#ifdef HAVE_PRAGMA_PACK -#pragma pack() -#endif -#ifdef HAVE_PRAGMA_PACK_HPPA -#pragma pack -#endif - - int main(int argc, char **argv) { - if (sizeof(s)!=sizeof(s.c)+sizeof(s.l)) - return 1; - if (sizeof(s) != sizeof(s3)) - return 2; - return (sizeof(s2) >= sizeof(s)) ? 0 : 3; - }], - [have_cv_struct_pack=yes], - [have_cv_struct_pack=no], - [have_cv_struct_pack=yes]) -]) -AC_MSG_RESULT([$have_cv_struct_pack]) - -if test "$have_cv_struct_pack" = "no"; then - AC_MSG_ERROR([Structure packing seems to be available, but is not working with this compiler]) -fi - -dnl Check if needs to be included for fd_set -AC_MSG_CHECKING([for fd_set]) -AC_HEADER_EGREP([fd_mask], [sys/select.h], [have_fd_set=yes]) -if test "$have_fd_set" = yes; then - AC_DEFINE([HAVE_SYS_SELECT_H], 1, "have ") - AC_MSG_RESULT([yes, found in sys/select.h]) -else - AC_TRY_COMPILE([#include - #include - #ifdef HAVE_UNISTD_H - #include - #endif], - [fd_set readMask, writeMask;], have_fd_set=yes, have_fd_set=no) - if test "$have_fd_set" = yes; then - AC_MSG_RESULT([yes, found in sys/types.h]) - else - AC_DEFINE([NO_FD_SET], 1, "no fd_set") - AC_MSG_RESULT(no) - fi -fi - -AC_MSG_CHECKING([default FD_SETSIZE value]) -AC_TRY_RUN([ -#include -#include -#include -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#include -int main(void) { - FILE *fp = fopen("conftestval", "w"); - if(fp) { - if(fprintf (fp, "%d\n", FD_SETSIZE) < 1) { - perror("fprintf failed"); - return errno; - } - } else { - perror("fopen failed"); - return errno; - } - return 0; -} -], -DEFAULT_FD_SETSIZE=`cat conftestval`, -DEFAULT_FD_SETSIZE=256, -DEFAULT_FD_SETSIZE=256) -AC_MSG_RESULT([$DEFAULT_FD_SETSIZE]) -AC_DEFINE_UNQUOTED([DEFAULT_FD_SETSIZE], $DEFAULT_FD_SETSIZE, "default FD_SETSIZE value") - -AC_MSG_CHECKING([stat64]) -AC_TRY_RUN([ -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE -#include -#include -#include -#include -#include - -int main(void) { - struct stat64 sb; - - if (stat64(".", &sb) == -1) - return errno; - - return 0; -} -], -[enable_stat64=yes], -[enable_stat64=no], -[enable_stat64=no], -) - -if test "$enable_stat64" != "no"; then -AC_DEFINE([HAVE_STAT64],1,[enable stat64]) -CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" -fi -AC_MSG_RESULT([$enable_stat64]) - -dnl Check signed right shift implementation -AC_MSG_CHECKING([whether signed right shift is sign extended]) -AC_TRY_RUN([int main(void){int a=-1;int b=a>>1;return(a!=b);}], - [have_signed_rightshift_extended=yes], - [have_signed_rightshift_extended=no], - [have_signed_rightshift_extended=no]) -if test $have_signed_rightshift_extended = yes; then - AC_DEFINE([HAVE_SAR], 1, [Define signed right shift implementation]) -fi -AC_MSG_RESULT([$have_signed_rightshift_extended]); - -AC_C_FDPASSING - -AC_DEFINE_UNQUOTED([VERSION],"$VERSION",[Version number of package]) -AC_DEFINE_UNQUOTED([VERSION_SUFFIX],"$VERSION_SUFFIX",[Version suffix for package]) - -AC_ARG_ENABLE(clamdtop, - AC_HELP_STRING([--enable-clamdtop], - [Enable 'clamdtop' tool @<:@default=auto@:>@]), -[enable_clamdtop=$enableval], [enable_clamdtop="auto"]) - -if test "$enable_clamdtop" != "no"; then - -AC_LIB_FIND([ncurses], [ncurses/ncurses.h], - AC_LANG_PROGRAM([#include ], - [initscr(); KEY_RESIZE;]), - [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES"; - CURSES_INCLUDE=""], - []) - -if test "X$HAVE_LIBNCURSES" != "Xyes"; then - HAVE_LIBNCURSES= - AC_LIB_FIND([ncurses], [ncurses.h], - AC_LANG_PROGRAM([#include ], - [initscr(); KEY_RESIZE;]), - [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES"; - CURSES_INCLUDE=""], - []) -fi - -if test "X$HAVE_LIBNCURSES" != "Xyes"; then - AC_LIB_FIND([pdcurses],[curses.h], - AC_LANG_PROGRAM([#include ], - [initscr(); KEY_RESIZE;]), - [CURSES_CPPFLAGS="$INCPDCURSES"; - CURSES_LIBS="$LTLIBPDCURSES"; - CURSES_INCLUDE=""], - [AC_MSG_WARN([****** not building clamdtop: ncurses not found])]) -fi - -if test "x$CURSES_LIBS" = "x" -a "$enable_clamdtop" = "yes"; then - AC_MSG_ERROR([ - -ERROR! Clamdtop was configured, but not found. You need to install libncurses5-dev. -]) -fi - -fi - -AC_DEFINE_UNQUOTED([CURSES_INCLUDE], $CURSES_INCLUDE, [curses header location]) -AC_SUBST([CURSES_CPPFLAGS]) -AC_SUBST([CURSES_LIBS]) -AM_CONDITIONAL([HAVE_CURSES], - [test "X$HAVE_LIBNCURSES" = "Xyes" || test "X$HAVE_LIBPDCURSES" = "Xyes"]) - -AC_ARG_ENABLE([distcheck-werror], - AC_HELP_STRING([--enable-distcheck-werror], - [enable warnings as error for distcheck - @<:@default=no@:>@]), -[enable_distcheckwerror=$enableval],[enable_distcheckwerror="no"]) - -# Enable distcheck warnings and Werror only for gcc versions that support them, -# and only after we've run the configure tests. -# Some configure tests fail (like checking for cos in -lm) if we enable these -# Werror flags for configure too (for example -Wstrict-prototypes makes -# configure think that -lm doesn't have cos, hence its in libc). -WERR_CFLAGS= -WERR_CFLAGS_MILTER= -if test "x$enable_distcheckwerror" = "xyes"; then - if test "$distcheck_enable_flags" = "1"; then - WERR_COMMON="-Wno-pointer-sign -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wno-error=strict-aliasing -Wno-error=bad-function-cast -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wno-error=type-limits -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=aggregate-return" - WERR_CFLAGS="$WERR_COMMON -Wwrite-strings" - WERR_CFLAGS_MILTER="$WERR_COMMON -Wno-error=format-nonliteral" - fi -fi -AC_SUBST([WERR_CFLAGS]) -AC_SUBST([WERR_CFLAGS_MILTER]) - -AC_ARG_ENABLE([llvm],AC_HELP_STRING([--enable-llvm], - [Enable 'llvm' JIT/verifier support @<:@default=auto@:>@]), - [enable_llvm=$enableval], [enable_llvm="auto"]) - -if test "$enable_llvm" != "no"; then - dnl Try to configure subdir, optionally - AC_CONFIG_SUBDIRS_OPTIONAL([libclamav/c++]) -fi - -AC_ARG_ENABLE([sha-collector-for-internal-use], [], [enable_sha_collector="yes"], [enable_sha_collector="no"]) -if test "$enable_sha_collector" != "no"; then - AC_DEFINE([HAVE__INTERNAL__SHA_COLLECT], 1, [For internal use only - DO NOT DEFINE]) -fi +m4_include([m4/reorganization/libs/libz.m4]) +m4_include([m4/reorganization/libs/bzip.m4]) +m4_include([m4/reorganization/libs/unrar.m4]) +m4_include([m4/reorganization/code_checks/ipv6.m4]) +m4_include([m4/reorganization/code_checks/dns.m4]) +m4_include([m4/reorganization/code_checks/fanotify.m4]) +m4_include([m4/reorganization/code_checks/setpgrp.m4]) +m4_include([m4/reorganization/milter/enable.m4]) +m4_include([m4/reorganization/code_checks/iconv.m4]) +m4_include([m4/reorganization/code_checks/pthreads.m4]) +m4_include([m4/reorganization/code_checks/reentrant.m4]) +m4_include([m4/reorganization/utility_checks/id.m4]) +m4_include([m4/reorganization/utility_checks/yp.m4]) +m4_include([m4/reorganization/usergroup.m4]) +m4_include([m4/reorganization/debug.m4]) +m4_include([m4/reorganization/customversion.m4]) +m4_include([m4/reorganization/nocache.m4]) +m4_include([m4/reorganization/dns.m4]) +m4_include([m4/reorganization/bigstack.m4]) +m4_include([m4/reorganization/dbdir.m4]) +m4_include([m4/reorganization/cfgdir.m4]) +m4_include([m4/reorganization/code_checks/in_port_t.m4]) +m4_include([m4/reorganization/code_checks/in_addr_t.m4]) +m4_include([m4/reorganization/os_checks.m4]) +m4_include([m4/reorganization/milter/check.m4]) +m4_include([m4/reorganization/code_checks/pthread_02.m4]) +m4_include([m4/reorganization/code_checks/readdir.m4]) +m4_include([m4/reorganization/code_checks/ctime.m4]) +m4_include([m4/reorganization/code_checks/socklen_t.m4]) +m4_include([m4/reorganization/clamav_user.m4]) +m4_include([m4/reorganization/code_checks/compiler_attribs.m4]) +m4_include([m4/reorganization/code_checks/select.m4]) +m4_include([m4/reorganization/code_checks/stat64.m4]) +m4_include([m4/reorganization/code_checks/shift.m4]) +m4_include([m4/reorganization/code_checks/features.m4]) +m4_include([m4/reorganization/clamdtop.m4]) +m4_include([m4/reorganization/distcheck.m4]) +m4_include([m4/reorganization/llvm.m4]) +m4_include([m4/reorganization/sha_collect.m4]) + +m4_include([m4/reorganization/bsd.m4]) + +dnl Freshclam dependencies +m4_include([m4/reorganization/libs/curl.m4]) +m4_include([m4/reorganization/libs/libconfig.m4]) +m4_include([m4/reorganization/libs/xml.m4]) + +m4_include([m4/reorganization/substitutions.m4]) AM_CONDITIONAL([ENABLE_CLAMSUBMIT], [test "$have_curl" = "yes"]) -AC_OUTPUT([ +AC_CONFIG_FILES([ +shared/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile +clamsubmit/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile -clamsubmit/Makefile etc/Makefile test/Makefile unit_tests/Makefile @@ -1802,6 +164,8 @@ docs/man/sigtool.1 docs/man/clamdtop.1 ]) +AC_OUTPUT + if test "$enable_llvm" = "yes" && test "$subdirfailed" != "no"; then AC_MSG_ERROR([Failed to configure LLVM, and LLVM was explicitly requested]) fi @@ -1855,7 +219,7 @@ AC_MSG_NOTICE([Summary of engine detection features]) CL_MSG_STATUS([bzip2 ],[$bzip_check],[$want_bzip2]) CL_MSG_STATUS([zlib ],[$ZLIB_HOME],[yes]) CL_MSG_STATUS([unrar ],[$want_unrar],[$want_unrar]) -if test "x$XML_LIBS" = "x"; then +if test "x$XML_LIBS" = "x"; then CL_MSG_STATUS([dmg and xar ],[no],[]) else CL_MSG_STATUS([dmg and xar ],[yes, from $XML_HOME],[]) diff --git a/database/Makefile.in b/database/Makefile.in index 280de169c..fc62910c7 100644 --- a/database/Makefile.in +++ b/database/Makefile.in @@ -83,6 +83,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -122,9 +176,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -144,6 +210,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -165,8 +232,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -204,6 +273,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/docs/Makefile.in b/docs/Makefile.in index 03470b0ed..cd470bbfe 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -82,6 +82,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -155,9 +209,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -177,6 +243,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -198,8 +265,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -237,6 +306,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/etc/Makefile.in b/etc/Makefile.in index 5fead1c96..6c9a0d2a8 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -84,6 +84,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -152,9 +206,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -174,6 +240,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -195,8 +262,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -234,6 +303,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/freshclam/Makefile.in b/freshclam/Makefile.in index 33fa6c2bf..587c97ac5 100644 --- a/freshclam/Makefile.in +++ b/freshclam/Makefile.in @@ -85,6 +85,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -158,9 +212,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -180,6 +246,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -201,8 +268,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -240,6 +309,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/libclamav/Makefile.in b/libclamav/Makefile.in index c55b00cc5..97ac770d6 100644 --- a/libclamav/Makefile.in +++ b/libclamav/Makefile.in @@ -95,6 +95,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -428,9 +482,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -450,6 +516,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -471,8 +538,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -510,6 +579,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/libltdl/Makefile.in b/libltdl/Makefile.in index f58f4721f..957e18f9b 100644 --- a/libltdl/Makefile.in +++ b/libltdl/Makefile.in @@ -73,6 +73,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -234,9 +288,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -256,6 +322,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -277,8 +344,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -316,6 +385,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/m4/reorganization/bigstack.m4 b/m4/reorganization/bigstack.m4 new file mode 100644 index 000000000..53898eb09 --- /dev/null +++ b/m4/reorganization/bigstack.m4 @@ -0,0 +1,7 @@ +AC_ARG_ENABLE([bigstack], +[ --enable-bigstack increase thread stack size], +enable_bigstack=$enableval, enable_bigstack="no") + +if test "$enable_bigstack" = "yes"; then + AC_DEFINE([C_BIGSTACK],1,[Increase thread stack size.]) +fi diff --git a/m4/reorganization/bsd.m4 b/m4/reorganization/bsd.m4 new file mode 100644 index 000000000..3dbca7c33 --- /dev/null +++ b/m4/reorganization/bsd.m4 @@ -0,0 +1,5 @@ +case "$host_os" in +freebsd*) +AC_CHECK_LIB([util], [kinfo_getvmmap], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lutil"], AC_MSG_ERROR([You are running BSD but you don't have kinfo_getvmmap in the util library. Please fix manually.])) +;; +esac diff --git a/m4/reorganization/build_tools.m4 b/m4/reorganization/build_tools.m4 new file mode 100644 index 000000000..760c398f5 --- /dev/null +++ b/m4/reorganization/build_tools.m4 @@ -0,0 +1,7 @@ +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL + +LT_LIB_M diff --git a/m4/reorganization/c_options.m4 b/m4/reorganization/c_options.m4 new file mode 100644 index 000000000..88d5d5814 --- /dev/null +++ b/m4/reorganization/c_options.m4 @@ -0,0 +1,6 @@ +AC_LIB_MULTILIB_GUESS + +AC_C_RESTRICT +AC_C_CONST +AC_C_INLINE +AC_C_BIGENDIAN diff --git a/m4/reorganization/cfgdir.m4 b/m4/reorganization/cfgdir.m4 new file mode 100644 index 000000000..341fe4486 --- /dev/null +++ b/m4/reorganization/cfgdir.m4 @@ -0,0 +1,17 @@ +dnl configure config directory +cfg_dir=`echo $sysconfdir | grep prefix` + +if test -n "$cfg_dir"; then + if test "$prefix" = "NONE" + then + cfg_dir="$ac_default_prefix/etc" + else + cfg_dir="$prefix/etc" + fi +else + cfg_dir="$sysconfdir" +fi + +CFGDIR=$cfg_dir +AC_SUBST([CFGDIR]) +AC_DEFINE_UNQUOTED([CONFDIR],"$cfg_dir",[where to look for the config file]) diff --git a/m4/reorganization/clamav_user.m4 b/m4/reorganization/clamav_user.m4 new file mode 100644 index 000000000..8a6219b52 --- /dev/null +++ b/m4/reorganization/clamav_user.m4 @@ -0,0 +1,57 @@ +dnl Check for clamav in /etc/passwd +if test "$test_clamav" = "yes" +then + dnl parse /etc/passwd + if test "$use_id" = "no" + then + AC_MSG_CHECKING([for $clamav_user in /etc/passwd]) + if test -r /etc/passwd; then + clamavuser=`cat /etc/passwd|grep "^$clamav_user:"` + clamavgroup=`cat /etc/group|grep "^$clamav_group:"` + fi + else + AC_MSG_CHECKING([for $clamav_user using id]) + id $clamav_user > /dev/null 2>&1 + if test "$?" = 0 ; then + clamavuser=1 + AC_PATH_PROG(GETENT, getent) + if test -n "$GETENT" ; then + clamavgroup=`$GETENT group | grep "^${clamav_group}:"` + else + clamavgroup=`cat /etc/group|grep $clamav_group` + fi + fi + fi + + if test "$use_netinfo" = "yes" + then + if test -x /usr/bin/dscl; then + AC_MSG_CHECKING([for $clamav_user using dscl]) + clamavuser=`/usr/bin/dscl . -list /Users |grep ${clamav_user}` + clamavgroup=`/usr/bin/dscl . -list /Groups |grep ${clamav_group}` + else + AC_MSG_CHECKING([for $clamav_user using netinfo]) + clamavuser=`/usr/bin/nidump passwd . |grep ${clamav_user}` + clamavgroup=`/usr/bin/nidump group . |grep ${clamav_group}` + fi + fi + + if test "$use_yp" = "yes" + then + AC_MSG_CHECKING([for $clamav_user using ypmatch]) + clamavuser=`ypmatch ${clamav_user} passwd` + clamavgroup=`ypmatch ${clamav_group} group` + fi + + if test -z "$clamavuser" || test -z "$clamavgroup" + then + AC_MSG_RESULT(no) + AC_MSG_ERROR([User $clamav_user (and/or group $clamav_group) doesn't exist. Please read the documentation !]) + else + AC_MSG_RESULT([yes, user $clamav_user and group $clamav_group]) + CLAMAVUSER="$clamav_user" + CLAMAVGROUP="$clamav_group" + AC_SUBST([CLAMAVUSER]) + AC_SUBST([CLAMAVGROUP]) + fi +fi diff --git a/m4/reorganization/clamdtop.m4 b/m4/reorganization/clamdtop.m4 new file mode 100644 index 000000000..3aedcd1a9 --- /dev/null +++ b/m4/reorganization/clamdtop.m4 @@ -0,0 +1,48 @@ +AC_ARG_ENABLE(clamdtop, + AC_HELP_STRING([--enable-clamdtop], + [Enable 'clamdtop' tool @<:@default=auto@:>@]), +[enable_clamdtop=$enableval], [enable_clamdtop="auto"]) + +if test "$enable_clamdtop" != "no"; then + +AC_LIB_FIND([ncurses], [ncurses/ncurses.h], + AC_LANG_PROGRAM([#include ], + [initscr(); KEY_RESIZE;]), + [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES"; + CURSES_INCLUDE=""], + []) + +if test "X$HAVE_LIBNCURSES" != "Xyes"; then + HAVE_LIBNCURSES= + AC_LIB_FIND([ncurses], [ncurses.h], + AC_LANG_PROGRAM([#include ], + [initscr(); KEY_RESIZE;]), + [CURSES_CPPFLAGS="$INCNCURSES"; CURSES_LIBS="$LTLIBNCURSES"; + CURSES_INCLUDE=""], + []) +fi + +if test "X$HAVE_LIBNCURSES" != "Xyes"; then + AC_LIB_FIND([pdcurses],[curses.h], + AC_LANG_PROGRAM([#include ], + [initscr(); KEY_RESIZE;]), + [CURSES_CPPFLAGS="$INCPDCURSES"; + CURSES_LIBS="$LTLIBPDCURSES"; + CURSES_INCLUDE=""], + [AC_MSG_WARN([****** not building clamdtop: ncurses not found])]) +fi + +if test "x$CURSES_LIBS" = "x" -a "$enable_clamdtop" = "yes"; then + AC_MSG_ERROR([ + +ERROR! Clamdtop was configured, but not found. You need to install libncurses5-dev. +]) +fi + +fi + +AC_DEFINE_UNQUOTED([CURSES_INCLUDE], $CURSES_INCLUDE, [curses header location]) +AC_SUBST([CURSES_CPPFLAGS]) +AC_SUBST([CURSES_LIBS]) +AM_CONDITIONAL([HAVE_CURSES], + [test "X$HAVE_LIBNCURSES" = "Xyes" || test "X$HAVE_LIBPDCURSES" = "Xyes"]) diff --git a/m4/reorganization/code_checks/compiler_attribs.m4 b/m4/reorganization/code_checks/compiler_attribs.m4 new file mode 100644 index 000000000..0c9298924 --- /dev/null +++ b/m4/reorganization/code_checks/compiler_attribs.m4 @@ -0,0 +1,126 @@ +dnl check for __attribute__((packed)) +dnl but only on compilers claiming to be gcc compatible +dnl because for example Sun's compiler silently ignores the packed attribute. +AC_MSG_CHECKING([for structure packing via __attribute__((packed))]) +AC_CACHE_VAL([have_cv_attrib_packed],[ + AC_TRY_COMPILE(, + [#ifdef __GNUC__ + struct { int i __attribute__((packed)); } s; + #else + #error Only checking for packed attribute on gcc-like compilers + #endif], + [have_cv_attrib_packed=yes], + [have_cv_attrib_packed=no]) + ]) +AC_MSG_RESULT([$have_cv_attrib_packed]) + +if test "$have_cv_attrib_packed" = no; then + AC_MSG_CHECKING([for structure packing via pragma]) + AC_CACHE_VAL([have_cv_pragma_pack],[ + AC_TRY_RUN([ + int main(int argc, char **argv) { +#pragma pack(1) /* has to be in column 1 ! */ + struct { char c; long l; } s; + return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ], + [have_cv_pragma_pack=yes], + [have_cv_pragma_pack=no]) + ]) + AC_MSG_RESULT([$have_cv_pragma_pack]) + if test "$have_cv_pragma_pack" = yes; then + AC_DEFINE([HAVE_PRAGMA_PACK], 1, "pragma pack") + else + AC_MSG_CHECKING([for structure packing via hppa/hp-ux pragma]) + AC_CACHE_VAL([have_cv_pragma_pack_hpux],[ + AC_TRY_RUN([ + /* hppa/hp-ux wants pragma outside of function */ +#pragma pack 1 /* has to be in column 1 ! */ + struct { char c; long l; } s; + int main(int argc, char **argv) { + return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ], + [have_cv_pragma_pack_hpux=yes], + [have_cv_pragma_pack_hpux=no]) + ]) + AC_MSG_RESULT([$have_cv_pragma_pack_hpux]) + AC_DEFINE([HAVE_PRAGMA_PACK_HPPA], 1, "pragma pack hppa/hp-ux style") + fi +fi + +dnl check for __attribute__((aligned)) +AC_MSG_CHECKING([for type aligning via __attribute__((aligned))]) +AC_CACHE_VAL([have_cv_attrib_aligned],[ + AC_TRY_COMPILE(, + [typedef int cl_aligned_int __attribute__((aligned));], + [have_cv_attrib_aligned=yes], + [have_cv_attrib_aligned=no]) + ]) +AC_MSG_RESULT([$have_cv_attrib_aligned]) + +if test "$have_cv_attrib_packed" = no -a "$have_cv_pragma_pack" = no -a "$have_cv_pragma_pack_hpux" = no; then + AC_MSG_ERROR(Need to know how to pack structures with this compiler) +fi + +if test "$have_cv_attrib_packed" = yes; then + AC_DEFINE([HAVE_ATTRIB_PACKED], 1, [attrib packed]) +fi + +if test "$have_cv_attrib_aligned" = yes; then + AC_DEFINE([HAVE_ATTRIB_ALIGNED], 1, [attrib aligned]) +fi + +dnl Sanity check that struct packing works +AC_MSG_CHECKING([that structure packing works]) +AC_CACHE_VAL([have_cv_struct_pack],[ + AC_TRY_RUN([ +#ifndef HAVE_ATTRIB_PACKED +#define __attribute__(x) +#endif +#ifdef HAVE_PRAGMA_PACK +#pragma pack(1) /* has to be in column 1 ! */ +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack 1 /* has to be in column 1 ! */ +#endif + +struct { char c __attribute__((packed)); long l __attribute__((packed)); } s; + +#ifdef HAVE_PRAGMA_PACK +#pragma pack() +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack +#endif + +struct { char c; long l;} s2; + +#ifdef HAVE_PRAGMA_PACK +#pragma pack(1) /* has to be in column 1 ! */ +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack 1 /* has to be in column 1 ! */ +#endif + +struct { char c; long l; } __attribute__((packed)) s3; + +#ifdef HAVE_PRAGMA_PACK +#pragma pack() +#endif +#ifdef HAVE_PRAGMA_PACK_HPPA +#pragma pack +#endif + + int main(int argc, char **argv) { + if (sizeof(s)!=sizeof(s.c)+sizeof(s.l)) + return 1; + if (sizeof(s) != sizeof(s3)) + return 2; + return (sizeof(s2) >= sizeof(s)) ? 0 : 3; + }], + [have_cv_struct_pack=yes], + [have_cv_struct_pack=no], + [have_cv_struct_pack=yes]) +]) +AC_MSG_RESULT([$have_cv_struct_pack]) + +if test "$have_cv_struct_pack" = "no"; then + AC_MSG_ERROR([Structure packing seems to be available, but is not working with this compiler]) +fi diff --git a/m4/reorganization/code_checks/coverage.m4 b/m4/reorganization/code_checks/coverage.m4 new file mode 100644 index 000000000..59f219e54 --- /dev/null +++ b/m4/reorganization/code_checks/coverage.m4 @@ -0,0 +1,22 @@ +AC_ARG_ENABLE(coverage, + AC_HELP_STRING([--enable-coverage], + [turn on test coverage + @<:@default=no@:>@]), +[enable_cov=$enableval],[enable_cov="no"]) + +if test "x$enable_coverage" = "xyes"; then + if test "x$CHECK_LIBS" = "x"; then + AC_MSG_ERROR([Coverage testing required, but unit tests not enabled!]) + fi + if test "x$ac_compiler_gnu" != "xyes"; then + AC_MSG_ERROR([coverage testing only works if gcc is used]) + fi + + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -lgcov" + AC_CHECK_PROGS(GCOV, gcov, false) + AC_CHECK_PROGS(LCOV, lcov, false) + AC_CHECK_PROGS(GENHTML, genhtml, false) +fi + +AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_coverage" = "xyes") diff --git a/m4/reorganization/code_checks/ctime.m4 b/m4/reorganization/code_checks/ctime.m4 new file mode 100644 index 000000000..fcc8cbbf8 --- /dev/null +++ b/m4/reorganization/code_checks/ctime.m4 @@ -0,0 +1,18 @@ +AC_MSG_CHECKING([for ctime_r]) +if test "$ac_cv_func_ctime_r" = "yes"; then + AC_TRY_COMPILE([ + #include + ],[ + char buf[31]; + time_t t; + ctime_r(&t, buf, 30); + ],[ + ac_cv_ctime_args=3 + AC_DEFINE([HAVE_CTIME_R_3],1,[ctime_r takes 3 arguments]) + ],[ + ac_cv_ctime_args=2 + AC_DEFINE([HAVE_CTIME_R_2],1,[ctime_r takes 2 arguments]) + ]) + + AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments]) +fi diff --git a/m4/reorganization/code_checks/dns.m4 b/m4/reorganization/code_checks/dns.m4 new file mode 100644 index 000000000..d0685b69b --- /dev/null +++ b/m4/reorganization/code_checks/dns.m4 @@ -0,0 +1 @@ +AC_C_DNS diff --git a/m4/reorganization/code_checks/fanotify.m4 b/m4/reorganization/code_checks/fanotify.m4 new file mode 100644 index 000000000..4540b0d96 --- /dev/null +++ b/m4/reorganization/code_checks/fanotify.m4 @@ -0,0 +1,3 @@ +AC_ARG_ENABLE([fanotify], +[ --disable-fanotify disable fanotify support (Linux only)], +want_fanotify=$enableval, want_fanotify="yes") diff --git a/m4/reorganization/code_checks/features.m4 b/m4/reorganization/code_checks/features.m4 new file mode 100644 index 000000000..91e969c17 --- /dev/null +++ b/m4/reorganization/code_checks/features.m4 @@ -0,0 +1 @@ +AC_C_FDPASSING diff --git a/m4/reorganization/code_checks/functions.m4 b/m4/reorganization/code_checks/functions.m4 new file mode 100644 index 000000000..857d8d36f --- /dev/null +++ b/m4/reorganization/code_checks/functions.m4 @@ -0,0 +1,13 @@ +AX_CHECK_UNAME_SYSCALL +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"]) +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")]) + +AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise]) +AC_FUNC_FSEEKO + +dnl Check if anon maps are available, check if we can determine the page size +AC_C_FUNC_MMAP_PRIVATE +AC_C_FUNC_PAGESIZE +AC_C_FUNC_MMAP_ANONYMOUS + +AC_CHECK_FUNCS([enable_extended_FILE_stdio]) diff --git a/m4/reorganization/code_checks/iconv.m4 b/m4/reorganization/code_checks/iconv.m4 new file mode 100644 index 000000000..fdde9f793 --- /dev/null +++ b/m4/reorganization/code_checks/iconv.m4 @@ -0,0 +1,32 @@ +dnl we need to try to link with iconv, otherwise there could be a +dnl mismatch between a 32-bit and 64-bit lib. Detect this at configure time. +dnl we need to check after zlib/bzip2, because they can change the include path +AC_ARG_WITH([iconv], [ --with-iconv supports iconv() (default=auto)], +[ + case "$withval" in + yes|no) wiconv="$withval";; + *) AC_MSG_ERROR([--with-iconv does not take an argument]);; + esac], +[ wiconv=auto ]) +if test "X$wiconv" != "Xno"; then + AC_CHECK_LIB([iconv], [libiconv_open], LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -liconv") + AC_MSG_CHECKING([for iconv]) + save_LIBS="$LIBS" + LIBS="$LIBCLAMAV_LIBS" + AC_TRY_LINK([ + #include + ],[ + char** xin,**xout; + unsigned long il,ol; + int rc; + iconv_t iconv_struct = iconv_open("UTF-16BE","UTF-8"); + rc = iconv(iconv_struct,xin,&il,xout,&ol); + iconv_close(iconv_struct); +],[ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_ICONV], 1, [iconv() available]) +],[ + AC_MSG_RESULT(no) +]) + LIBS="$save_LIBS" +fi diff --git a/m4/reorganization/code_checks/in_addr_t.m4 b/m4/reorganization/code_checks/in_addr_t.m4 new file mode 100644 index 000000000..75eccd7ee --- /dev/null +++ b/m4/reorganization/code_checks/in_addr_t.m4 @@ -0,0 +1,12 @@ +dnl check for in_addr_t definition +AC_MSG_CHECKING([for in_addr_t definition]) +AC_TRY_COMPILE([ +#include +#include +], +[ in_addr_t pt; pt = 0; return pt; ], +[ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_IN_ADDR_T],1,[in_addr_t is defined]) +], +AC_MSG_RESULT(no)) diff --git a/m4/reorganization/code_checks/in_port_t.m4 b/m4/reorganization/code_checks/in_port_t.m4 new file mode 100644 index 000000000..915ea20fa --- /dev/null +++ b/m4/reorganization/code_checks/in_port_t.m4 @@ -0,0 +1,12 @@ +dnl check for in_port_t definition +AC_MSG_CHECKING([whether in_port_t is defined]) +AC_TRY_COMPILE([ +#include +#include +], +[in_port_t pt; pt = 0; return pt;], +[ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_IN_PORT_T],1,[in_port_t is defined]) +], +AC_MSG_RESULT(no)) diff --git a/m4/reorganization/code_checks/ipv6.m4 b/m4/reorganization/code_checks/ipv6.m4 new file mode 100644 index 000000000..81ff7ac28 --- /dev/null +++ b/m4/reorganization/code_checks/ipv6.m4 @@ -0,0 +1,39 @@ +AC_ARG_ENABLE([ipv6], +[ --disable-ipv6 disable IPv6 support], +want_ipv6=$enableval, want_ipv6="yes") + +if test "$want_ipv6" = "yes" +then + AC_MSG_CHECKING([for IPv6 support]) + AC_CACHE_VAL([have_cv_ipv6],[ + AC_TRY_RUN([ + #include + #include + #include + #include + int main(int argc, char **argv) + { + struct addrinfo *res, hints; + int sd; + + if((sd = socket(AF_INET6, SOCK_STREAM, 0)) < 0) + return 1; + close(sd); + /* also check if getaddrinfo() handles AF_UNSPEC -- bb#1196 */ + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + if(getaddrinfo("127.0.0.1", NULL, &hints, &res) < 0) + return 1; + freeaddrinfo(res); + return 0; + } + ], + [have_cv_ipv6=yes], + [have_cv_ipv6=no], + [have_cv_ipv6=no]) + ]) + AC_MSG_RESULT([$have_cv_ipv6]) + if test "$have_cv_ipv6" = yes; then + AC_DEFINE(SUPPORT_IPv6, 1, [Support for IPv6]) + fi +fi diff --git a/m4/reorganization/code_checks/mpool.m4 b/m4/reorganization/code_checks/mpool.m4 new file mode 100644 index 000000000..c0bf170ff --- /dev/null +++ b/m4/reorganization/code_checks/mpool.m4 @@ -0,0 +1,18 @@ +AC_ARG_ENABLE([mempool],[ --disable-mempool disable memory pools], enable_mempool=$enableval, enable_mempool="yes") +have_mempool="no" +if test "$enable_mempool" = "yes"; then + if test "$ac_cv_c_mmap_private" != "yes"; then + AC_MSG_NOTICE([****** mempool support disabled (mmap not available or not usable)]) + else + if test "$ac_cv_c_can_get_pagesize" != "yes"; then + AC_MSG_NOTICE([****** mempool support disabled (pagesize cannot be determined)]) + else + if test "$ac_cv_c_mmap_anonymous" = "no"; then + AC_MSG_NOTICE([****** mempool support disabled (anonymous mmap not available)]) + else + AC_DEFINE([USE_MPOOL],1,[enable memory pools]) + have_mempool="yes" + fi + fi + fi +fi diff --git a/m4/reorganization/code_checks/pthread_02.m4 b/m4/reorganization/code_checks/pthread_02.m4 new file mode 100644 index 000000000..db5b8fd79 --- /dev/null +++ b/m4/reorganization/code_checks/pthread_02.m4 @@ -0,0 +1,11 @@ +if test "$have_pthreads" = "yes" +then + save_LIBS="$LIBS" + LIBS="$THREAD_LIBS $LIBS" + AC_CHECK_FUNCS([sched_yield pthread_yield]) + LIBS="$save_LIBS" + AC_DEFINE([BUILD_CLAMD], 1, "build clamd") + dnl define these here, so we don't forget any system + AC_DEFINE([CL_THREAD_SAFE],1,[thread safe]) + AC_DEFINE([_REENTRANT],1,[thread safe]) +fi diff --git a/m4/reorganization/code_checks/pthreads.m4 b/m4/reorganization/code_checks/pthreads.m4 new file mode 100644 index 000000000..4d4312b9a --- /dev/null +++ b/m4/reorganization/code_checks/pthreads.m4 @@ -0,0 +1,3 @@ +AC_ARG_ENABLE([pthreads], +[ --disable-pthreads disable POSIX threads support], +have_pthreads=$enableval,) diff --git a/m4/reorganization/code_checks/readdir.m4 b/m4/reorganization/code_checks/readdir.m4 new file mode 100644 index 000000000..ae960e0f1 --- /dev/null +++ b/m4/reorganization/code_checks/readdir.m4 @@ -0,0 +1,46 @@ +dnl Check for readdir_r and number of its arguments +dnl Code from libwww/configure.in + +AC_MSG_CHECKING([for readdir_r]) +if test -z "$ac_cv_readdir_args"; then + AC_TRY_COMPILE( + [ +#include +#include + ], + [ + struct dirent dir, *dirp; + DIR *mydir; + dirp = readdir_r(mydir, &dir); + ], ac_cv_readdir_args=2) +fi +if test -z "$ac_cv_readdir_args"; then + AC_TRY_COMPILE( + [ +#include +#include + ], + [ + struct dirent dir, *dirp; + DIR *mydir; + int rc; + rc = readdir_r(mydir, &dir, &dirp); + ], ac_cv_readdir_args=3) +fi + +AC_ARG_ENABLE([readdir_r], +[ --enable-readdir_r enable support for readdir_r], +enable_readdir_r=$enableval, enable_readdir_r="no") + +if test "$enable_readdir_r" = "no"; then + AC_MSG_RESULT(support disabled) +elif test -z "$ac_cv_readdir_args"; then + AC_MSG_RESULT(no) +else + if test "$ac_cv_readdir_args" = 2; then + AC_DEFINE([HAVE_READDIR_R_2],1,[readdir_r takes 2 arguments]) + elif test "$ac_cv_readdir_args" = 3; then + AC_DEFINE([HAVE_READDIR_R_3],1,[readdir_r takes 3 arguments]) + fi + AC_MSG_RESULT([yes, and it takes $ac_cv_readdir_args arguments]) +fi diff --git a/m4/reorganization/code_checks/reentrant.m4 b/m4/reorganization/code_checks/reentrant.m4 new file mode 100644 index 000000000..975b6db29 --- /dev/null +++ b/m4/reorganization/code_checks/reentrant.m4 @@ -0,0 +1,3 @@ +AC_ARG_ENABLE([cr], +[ --disable-cr don't link with C reentrant library (BSD) ], +use_cr=$enableval,) diff --git a/m4/reorganization/code_checks/select.m4 b/m4/reorganization/code_checks/select.m4 new file mode 100644 index 000000000..3f479c1ad --- /dev/null +++ b/m4/reorganization/code_checks/select.m4 @@ -0,0 +1,52 @@ +dnl Check if needs to be included for fd_set +AC_MSG_CHECKING([for fd_set]) +AC_HEADER_EGREP([fd_mask], [sys/select.h], [have_fd_set=yes]) +if test "$have_fd_set" = yes; then + AC_DEFINE([HAVE_SYS_SELECT_H], 1, "have ") + AC_MSG_RESULT([yes, found in sys/select.h]) +else + AC_TRY_COMPILE([#include + #include + #ifdef HAVE_UNISTD_H + #include + #endif], + [fd_set readMask, writeMask;], have_fd_set=yes, have_fd_set=no) + if test "$have_fd_set" = yes; then + AC_MSG_RESULT([yes, found in sys/types.h]) + else + AC_DEFINE([NO_FD_SET], 1, "no fd_set") + AC_MSG_RESULT(no) + fi +fi + +AC_MSG_CHECKING([default FD_SETSIZE value]) +AC_TRY_RUN([ +#include +#include +#include +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#include +int main(void) { + FILE *fp = fopen("conftestval", "w"); + if(fp) { + if(fprintf (fp, "%d\n", FD_SETSIZE) < 1) { + perror("fprintf failed"); + return errno; + } + } else { + perror("fopen failed"); + return errno; + } + return 0; +} +], +DEFAULT_FD_SETSIZE=`cat conftestval`, +DEFAULT_FD_SETSIZE=256, +DEFAULT_FD_SETSIZE=256) +AC_MSG_RESULT([$DEFAULT_FD_SETSIZE]) +AC_DEFINE_UNQUOTED([DEFAULT_FD_SETSIZE], $DEFAULT_FD_SETSIZE, "default FD_SETSIZE value") diff --git a/m4/reorganization/code_checks/setpgrp.m4 b/m4/reorganization/code_checks/setpgrp.m4 new file mode 100644 index 000000000..0ba21cdf2 --- /dev/null +++ b/m4/reorganization/code_checks/setpgrp.m4 @@ -0,0 +1,19 @@ +dnl AC_FUNC_SETPGRP does not work when cross compiling +dnl Instead, assume we will have a prototype for setpgrp if cross compiling. +dnl testcase from gdb/configure.ac +if test "$cross_compiling" = no; then + AC_FUNC_SETPGRP +else + AC_CACHE_CHECK([whether setpgrp takes no argument], [ac_cv_func_setpgrp_void], + [AC_TRY_COMPILE([ +#include +], [ + if (setpgrp(1,1) == -1) + exit (0); + else + exit (1); +], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)]) +if test $ac_cv_func_setpgrp_void = yes; then + AC_DEFINE([SETPGRP_VOID], 1) +fi +fi diff --git a/m4/reorganization/code_checks/shift.m4 b/m4/reorganization/code_checks/shift.m4 new file mode 100644 index 000000000..25981d7aa --- /dev/null +++ b/m4/reorganization/code_checks/shift.m4 @@ -0,0 +1,10 @@ +dnl Check signed right shift implementation +AC_MSG_CHECKING([whether signed right shift is sign extended]) +AC_TRY_RUN([int main(void){int a=-1;int b=a>>1;return(a!=b);}], + [have_signed_rightshift_extended=yes], + [have_signed_rightshift_extended=no], + [have_signed_rightshift_extended=no]) +if test $have_signed_rightshift_extended = yes; then + AC_DEFINE([HAVE_SAR], 1, [Define signed right shift implementation]) +fi +AC_MSG_RESULT([$have_signed_rightshift_extended]); diff --git a/m4/reorganization/code_checks/socklen_t.m4 b/m4/reorganization/code_checks/socklen_t.m4 new file mode 100644 index 000000000..74f4f0dfe --- /dev/null +++ b/m4/reorganization/code_checks/socklen_t.m4 @@ -0,0 +1,41 @@ +dnl Determine socklen_t type. Code from lftp. +AC_MSG_CHECKING([for socklen_t]) +AC_CACHE_VAL([ac_cv_socklen_t], +[ + ac_cv_socklen_t=no + AC_TRY_COMPILE([ + #include + #include + ], + [ + socklen_t len; + getpeername(0,0,&len); + ], + [ + ac_cv_socklen_t=yes + ]) +]) +AC_MSG_RESULT([$ac_cv_socklen_t]) + if test $ac_cv_socklen_t = no; then + AC_MSG_CHECKING([for socklen_t equivalent]) + AC_CACHE_VAL([ac_cv_socklen_t_equiv], + [ + ac_cv_socklen_t_equiv=int + for t in int size_t unsigned long "unsigned long"; do + AC_TRY_COMPILE([ + #include + #include + ], + [ + $t len; + getpeername(0,0,&len); + ], + [ + ac_cv_socklen_t_equiv="$t" + break + ]) + done + ]) + AC_MSG_RESULT([$ac_cv_socklen_t_equiv]) + AC_DEFINE_UNQUOTED([socklen_t], $ac_cv_socklen_t_equiv, [Define to "int" if does not define.]) +fi diff --git a/m4/reorganization/code_checks/stat64.m4 b/m4/reorganization/code_checks/stat64.m4 new file mode 100644 index 000000000..9e0775acb --- /dev/null +++ b/m4/reorganization/code_checks/stat64.m4 @@ -0,0 +1,29 @@ +AC_MSG_CHECKING([stat64]) +AC_TRY_RUN([ +#define _LARGEFILE_SOURCE +#define _LARGEFILE64_SOURCE +#include +#include +#include +#include +#include + +int main(void) { + struct stat64 sb; + + if (stat64(".", &sb) == -1) + return errno; + + return 0; +} +], +[enable_stat64=yes], +[enable_stat64=no], +[enable_stat64=no], +) + +if test "$enable_stat64" != "no"; then +AC_DEFINE([HAVE_STAT64],1,[enable stat64]) +CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" +fi +AC_MSG_RESULT([$enable_stat64]) diff --git a/m4/reorganization/code_checks/unit_tests.m4 b/m4/reorganization/code_checks/unit_tests.m4 new file mode 100644 index 000000000..ce9b0cd00 --- /dev/null +++ b/m4/reorganization/code_checks/unit_tests.m4 @@ -0,0 +1,21 @@ +enable_check_ut=auto +enable_ut_install=no +AC_ARG_ENABLE(check, +[ --enable-check Enable 'check' unit tests (default=auto)], enable_check_ut=$enableval, enable_check_ut="auto" ) + +if test "$enable_check_ut" != "no" ; then + AC_LIB_FIND([check],[check.h], + AC_LANG_PROGRAM([#include ],[srunner_create(0)]), + [CHECK_CPPFLAGS="$INCCHECK"; CHECK_LIBS="$LTLIBCHECK"], + []) +fi +AC_SUBST([CHECK_CPPFLAGS]) +AC_SUBST([CHECK_LIBS]) +AM_CONDITIONAL([HAVE_LIBCHECK],test "X$HAVE_LIBCHECK" = "Xyes") + +if test "x$CHECK_LIBS" = "x" -a "$enable_check_ut" = "yes"; then + AC_MSG_ERROR([ + +ERROR! Check was configured, but not found. Get it from http://check.sf.net/ +]) +fi diff --git a/m4/reorganization/compiler_checks.m4 b/m4/reorganization/compiler_checks.m4 new file mode 100644 index 000000000..a2bc611d9 --- /dev/null +++ b/m4/reorganization/compiler_checks.m4 @@ -0,0 +1,285 @@ +AC_ARG_ENABLE([gcc-vcheck], +[ --disable-gcc-vcheck do not check for buggy gcc version ], +gcc_check=$enableval, gcc_check="yes") + +msg_gcc_check="use --disable-gcc-vcheck to disable this check. Before reporting any bugs check with a supported version of gcc" +VERSION_SUFFIX= +dnl Check for gcc-4.1.0 +if test "$gcc_check" = "yes"; then + if test "x$ac_compiler_gnu" = "xyes"; then + AC_MSG_CHECKING([for a supported version of gcc]) + gcc_version=`${CC} -dumpversion` + case "${gcc_version}" in + 4.1.0*) + AC_MSG_RESULT([no (${gcc_version})]) + AC_MSG_ERROR([gcc 4.1.0 is known to incorrectly compile upx.c. Upgrade your compiler to at least 4.1.1/4.1.2)]) + ;; + *) + AC_MSG_RESULT([ok (${gcc_version})]) + ;; + esac + case "${gcc_version}" in + [[56789]].* | 4.[[3456789]].*) + # bb #1581 - temporarely add -fno-strict-aliasing so gcc 4.4.0 + # works correctly + CFLAGS="$CFLAGS -fno-strict-aliasing" + ;; + *) + ;; + esac + fi +else + CFLAGS="$CFLAGS -O0" + VERSION_SUFFIX="$VERSION_SUFFIX-broken-compiler" +fi + +# add distcheck warning flags +distcheck_enable_flags=0 +if test "x$ac_compiler_gnu" = "xyes"; then + gcc_version=`${CC} -dumpversion` + case "${gcc_version}" in + 4.[[3456789]]*) + distcheck_enable_flags=1 + ;; + [[56789]].*) + distcheck_enable_flags=1 + ;; + esac +fi + +dnl Checks if compiler produces valid code, regardless of compiler +dnl we do these checks here to avoid receiving endless bugreports about +dnl breakages due to compiler bugs. + +dnl Check if compiler produces invalid code on gcc PR27603 (affects upx.c) +dnl testcase from gcc testsuite +AC_MSG_CHECKING([for gcc bug PR27603]) +AC_TRY_RUN( + [ +/* (C) Richard Guenther */ +void exit (int); +void abort (void); +int a; +int main(void) +{ + int j; + for (j = 0; j < 6; j++) + { + if ((unsigned)j - 3 <= 1) + exit (0); + a = 1000 * (6 - j); + } + abort (); +} +], [AC_MSG_RESULT([ok, bug not present])], +[AC_MSG_ERROR([your compiler has gcc PR27603 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27603])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) + +dnl Check if compiler produces invalid code on gcc PR26763-2 (affects upx.c) +dnl testcase from gcc testsuite +AC_MSG_CHECKING([for gcc bug PR26763-2]) +AC_TRY_RUN( + [ +/* (C) Richard Guenther */ +extern void abort(void); + +static int try (char *a, int d) +{ + return a + d > a; +} + +int main(void) +{ + char bla[100]; + + if (try (bla + 50, -1)) + abort (); + + return 0; +} +], [AC_MSG_RESULT([ok, bug not present])], +[AC_MSG_ERROR([your compiler has gcc PR26763-2 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763])],[AC_MSG_RESULT([cross-compiling, assumed ok])]) + +dnl Check if compiler produces invalid code on own testcase based on upx.c +AC_MSG_CHECKING([for valid code generation of CLI_ISCONTAINED]) +AC_TRY_RUN( + [ +#include +static struct v{ + char* dst; + unsigned int dsize; + unsigned int dcur; + unsigned int backsize; + signed int unp_offset; +} values[] = { + {(char*)0xf78ab008, 0x2e000, 1, 4, -1594}, + {(char*)0xb7af1008, 0x2e000, 1, 4, -1594} + +}; +extern void abort(void); + +#define CLI_ISCONTAINED(bb, bb_size, sb, sb_size) \ + ((bb_size) > 0 && (sb_size) > 0 && (size_t)(sb_size) <= (size_t)(bb_size) \ + && (sb) >= (bb) && ((sb) + (sb_size)) <= ((bb) + (bb_size)) && ((sb) + (sb_size)) > (bb) && (sb) < ((bb) + (bb_size))) + +int crashtest() +{ + unsigned int backsize, dcur; + int dval=0x12000, unp_offset; + int* dsize = &dval; + char* dst = (char*)0x12000; + while(1) { + backsize=4; + dcur=0; + unp_offset=0x800002c7; + + if (!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || !CLI_ISCONTAINED(dst, *dsize, dst+dcur, backsize) || unp_offset >=0) + return -1; + abort(); + } + return 0; +} + +int main(void) +{ + int i; + for(i=0;idst; + unsigned int* dsize = &v->dsize; + unsigned int dcur = v->dcur; + unsigned int backsize = v->backsize-1; + signed int unp_offset = v->unp_offset; + + if(!CLI_ISCONTAINED(dst, *dsize, dst+dcur+unp_offset, backsize) || + !CLI_ISCONTAINED(dst, *dsize,dst+dcur,backsize) || unp_offset >= 0) { + continue; + } + abort(); + } + crashtest(); + return 0; +} +], [AC_MSG_RESULT([ok, bug not present])], +[AC_MSG_ERROR([your compiler has a bug that causes clamav bug no. 670, use a different compiler, see http://bugs.clamav.net/bugzilla/show_bug.cgi?id=670])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) + +dnl Check if compiler produces invalid code on gcc PR28045 (affects upx.c) +dnl testcase from gcc testsuite +AC_MSG_CHECKING([for gcc bug PR28045]) +AC_TRY_RUN( + [ +/* (C) Andrew Pinski */ +extern void abort(void); +struct a +{ + unsigned int bits : 1; + signed long val : ((sizeof(long) * 8) - 1); +}; +static int Fnegate (struct a b) +{ + if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL)) + && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1)) + return 0 ; + abort (); +} +int main (void) +{ + struct a b = {1, 1}; + Fnegate (b); + return 0; +} +], [AC_MSG_RESULT([ok, bug not present])], +[AC_MSG_ERROR([your compiler has gcc PR28045 bug, use a different compiler, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28045])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) + +dnl Check if compiler produces invalid code on gcc PR37573 (affects autoit.c) +dnl this is a bug in gcc 4.4.0, but for some reason it affects gcc 4.1.2 too +dnl gcc 4.1.3 is OK. This bug occurs only at -O3. +AC_MSG_CHECKING([for gcc bug PR37573]) +AC_TRY_RUN( + [ +#include +#include +struct S +{ + unsigned int *a; + unsigned int b; + unsigned int c[624]; +}; +static unsigned char +foo (struct S *s) +{ + unsigned int r; + if (!--s->b) + { + unsigned int *c = s->c; + unsigned int i; + s->a = c; + for (i = 0; i < 227; i++) + c[i] = + ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ + ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i + 397]; + for (; i < 623; i++) + c[i] = + ((((c[i] ^ c[i + 1]) & 0x7ffffffe) ^ c[i]) >> 1) ^ + ((0 - (c[i + 1] & 1)) & 0x9908b0df) ^ c[i - 227]; + c[623] = + ((((c[623] ^ c[0]) & 0x7ffffffe) ^ c[623]) >> 1) ^ ((0 - (c[0] & 1)) & + 0x9908b0df) ^ c[i + - + 227]; + } + r = *(s->a++); + r ^= (r >> 11); + r ^= ((r & 0xff3a58ad) << 7); + r ^= ((r & 0xffffdf8c) << 15); + r ^= (r >> 18); + return (unsigned char) (r >> 1); +} + +void +bar (unsigned char *p, unsigned int q, unsigned int r) +{ + struct S s; + unsigned int i; + unsigned int *c = s.c; + *c = r; + for (i = 1; i < 624; i++) + c[i] = i + 0x6c078965 * ((c[i - 1] >> 30) ^ c[i - 1]); + s.b = 1; + while (q--) + *p++ ^= foo (&s); +}; + +static unsigned char p[23] = { + 0xc0, 0x49, 0x17, 0x32, 0x62, 0x1e, 0x2e, 0xd5, 0x4c, 0x19, 0x28, 0x49, + 0x91, 0xe4, 0x72, 0x83, 0x91, 0x3d, 0x93, 0x83, 0xb3, 0x61, 0x38 +}; + +static unsigned char q[23] = { + 0x3e, 0x41, 0x55, 0x54, 0x4f, 0x49, 0x54, 0x20, 0x55, 0x4e, 0x49, 0x43, + 0x4f, 0x44, 0x45, 0x20, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x3c +}; + +int +main (void) +{ + unsigned int s; + s = 23; + bar (p, s, s + 0xa25e); + if (memcmp (p, q, s) != 0) + abort (); + return 0; +} + +], [AC_MSG_RESULT([ok, bug not present])], +[AC_MSG_ERROR([your compiler has gcc PR37573 bug, use a lower optimization level (-O1 or -O2), see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37573])], [AC_MSG_RESULT([cross-compiling, assumed ok])]) + +# It's not fatal if gperf is missing +AM_MISSING_PROG(GPERF, gperf) +AC_SUBST(GPERF) + +AC_TYPE_OFF_T +AC_COMPILE_CHECK_SIZEOF([short]) +AC_COMPILE_CHECK_SIZEOF([int]) +AC_COMPILE_CHECK_SIZEOF([long]) +AC_COMPILE_CHECK_SIZEOF([long long]) +AC_COMPILE_CHECK_SIZEOF([void *]) diff --git a/m4/reorganization/customversion.m4 b/m4/reorganization/customversion.m4 new file mode 100644 index 000000000..b9c70f7d1 --- /dev/null +++ b/m4/reorganization/customversion.m4 @@ -0,0 +1,3 @@ +AC_ARG_WITH([version], +[ --with-version=STR use custom version string (dev only)], +VERSION="$withval", ) diff --git a/m4/reorganization/dbdir.m4 b/m4/reorganization/dbdir.m4 new file mode 100644 index 000000000..9dbe84c00 --- /dev/null +++ b/m4/reorganization/dbdir.m4 @@ -0,0 +1,18 @@ +AC_ARG_WITH([dbdir], +[ --with-dbdir=path path to virus database directory], +db_dir="$withval", db_dir="_default_") + +dnl I had problems with $pkgdatadir thus these funny checks +if test "$db_dir" = "_default_" +then + if test "$prefix" = "NONE" + then + db_dir="$ac_default_prefix/share/clamav" + else + db_dir="$prefix/share/clamav" + fi +fi + +AC_DEFINE_UNQUOTED([DATADIR],"$db_dir", [Path to virus database directory.]) +DBDIR="$db_dir" +AC_SUBST([DBDIR]) diff --git a/m4/reorganization/debug.m4 b/m4/reorganization/debug.m4 new file mode 100644 index 000000000..9b900eaa6 --- /dev/null +++ b/m4/reorganization/debug.m4 @@ -0,0 +1,6 @@ +if test "$enable_debug" = "yes"; then + VERSION_SUFFIX="$VERSION_SUFFIX-debug" + AC_DEFINE([CL_DEBUG],1,[enable debugging]) +else + AC_DEFINE([NDEBUG],1,[disable assertions]) +fi diff --git a/m4/reorganization/distcheck.m4 b/m4/reorganization/distcheck.m4 new file mode 100644 index 000000000..9f49a49d6 --- /dev/null +++ b/m4/reorganization/distcheck.m4 @@ -0,0 +1,22 @@ +AC_ARG_ENABLE([distcheck-werror], + AC_HELP_STRING([--enable-distcheck-werror], + [enable warnings as error for distcheck + @<:@default=no@:>@]), +[enable_distcheckwerror=$enableval],[enable_distcheckwerror="no"]) + +# Enable distcheck warnings and Werror only for gcc versions that support them, +# and only after we've run the configure tests. +# Some configure tests fail (like checking for cos in -lm) if we enable these +# Werror flags for configure too (for example -Wstrict-prototypes makes +# configure think that -lm doesn't have cos, hence its in libc). +WERR_CFLAGS= +WERR_CFLAGS_MILTER= +if test "x$enable_distcheckwerror" = "xyes"; then + if test "$distcheck_enable_flags" = "1"; then + WERR_COMMON="-Wno-pointer-sign -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wno-error=strict-aliasing -Wno-error=bad-function-cast -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wno-error=type-limits -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=aggregate-return" + WERR_CFLAGS="$WERR_COMMON -Wwrite-strings" + WERR_CFLAGS_MILTER="$WERR_COMMON -Wno-error=format-nonliteral" + fi +fi +AC_SUBST([WERR_CFLAGS]) +AC_SUBST([WERR_CFLAGS_MILTER]) diff --git a/m4/reorganization/dns.m4 b/m4/reorganization/dns.m4 new file mode 100644 index 000000000..b88ea43ef --- /dev/null +++ b/m4/reorganization/dns.m4 @@ -0,0 +1,7 @@ +AC_ARG_ENABLE([dns-fix], +[ --enable-dns-fix enable workaround for broken DNS servers (as in SpeedTouch 510)], +enable_dnsfix=$enableval, enable_dnsfix="no") + +if test "$enable_dnsfix" = "yes"; then + AC_DEFINE([FRESHCLAM_DNS_FIX],1,[enable workaround for broken DNS servers]) +fi diff --git a/m4/reorganization/headers.m4 b/m4/reorganization/headers.m4 new file mode 100644 index 000000000..df6470438 --- /dev/null +++ b/m4/reorganization/headers.m4 @@ -0,0 +1,10 @@ +AC_INCLUDES_DEFAULT + +AC_CHECK_HEADERS([stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h sys/times.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h limits.h sys/filio.h sys/uio.h termios.h stdbool.h pwd.h grp.h]) +AC_CHECK_HEADER([syslog.h],AC_DEFINE([USE_SYSLOG],1,[use syslog]),) + +have_pthreads=no +AC_CHECK_HEADER([pthread.h],[have_pthreads=yes]) +if test "$have_pthreads" = "yes"; then + AC_DEFINE([HAVE_PTHREAD_H],1,[Define to 1 if you have the header file]) +fi diff --git a/m4/reorganization/libs/bzip.m4 b/m4/reorganization/libs/bzip.m4 new file mode 100644 index 000000000..f0ae99b81 --- /dev/null +++ b/m4/reorganization/libs/bzip.m4 @@ -0,0 +1,82 @@ + +AC_ARG_ENABLE([bzip2], +[ --disable-bzip2 disable bzip2 support], +want_bzip2=$enableval, want_bzip2="yes") + +bzip_check="ok" +if test "$want_bzip2" = "yes" +then + AC_LIB_LINKFLAGS([bz2]) + save_LDFLAGS="$LDFLAGS" + # Only add -L if prefix is not empty + test -z "$LIBBZ2_PREFIX" || LDFLAGS="$LDFLAGS -L$LIBBZ2_PREFIX/$acl_libdirstem"; + + have_bzprefix="no" + AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [have_bzprefix="yes"]) + if test "x$have_bzprefix" = "xno"; then + AC_DEFINE([NOBZ2PREFIX],1,[bzip funtions do not have bz2 prefix]) + fi + LDFLAGS="$save_LDFLAGS" + if test "$HAVE_LIBBZ2" = "yes"; then + AC_CHECK_HEADER([bzlib.h], + [AC_C_CVE_2008_1372], + [ac_cv_c_cve_2008_1372="no"]) + if test "$ac_cv_c_cve_2008_1372" = "bugged"; then + AC_MSG_WARN([****** bzip2 libraries are affected by the CVE-2008-1372 bug]) + AC_MSG_WARN([****** We strongly suggest you to update to bzip2 1.0.5.]) + AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) + bzip_check="bugged (CVE-2008-1372)" + fi + if test "$ac_cv_c_cve_2008_1372" = "linkfailed"; then + dnl This shouldn't happen + dnl We failed to link but libtool may still be able to link, so don't disable bzip2 just yet + AC_MSG_WARN([****** Unable to link bzip2 testcase]) + AC_MSG_WARN([****** You may be affected by CVE-2008-1372 bug, but I need to be able to link a testcase to verify]) + AC_MSG_WARN([****** It is recommended to fix your build environment so that we can run the testcase!]) + AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) + bzip_check="link failed (CVE-2008-1372)" + fi + + case "$ac_cv_c_cve_2008_1372" in + ok|bugged|linkfailed) + ;; + *) + HAVE_LIBBZ2=no + ;; + esac + fi + + if test "$HAVE_LIBBZ2" = "yes"; then + AC_C_CVE_2010_0405 + if test "$ac_cv_c_cve_2010_0405" = "bugged"; then + AC_MSG_WARN([****** bzip2 libraries are affected by the CVE-2010-0405 bug]) + AC_MSG_WARN([****** We strongly suggest you to update bzip2]) + AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) + bzip_check="bugged (CVE-2010-0405)" + fi + if test "$ac_cv_c_cve_2010_0405" = "linkfailed"; then + dnl This shouldn't happen + dnl We failed to link but libtool may still be able to link, so don't disable bzip2 just yet + AC_MSG_WARN([****** Unable to link bzip2 testcase]) + AC_MSG_WARN([****** You may be affected by CVE-2010-0405 bug, but I need to be able to link a testcase to verify]) + AC_MSG_WARN([****** It is recommended to fix your build environment so that we can run the testcase!]) + AC_MSG_WARN([****** Please do not report stability problems to the ClamAV developers!]) + bzip_check="link failed (CVE-2010-0405)" + fi + + case "$ac_cv_c_cve_2010_0405" in + ok|bugged|linkfailed) + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS $LTLIBBZ2" + AC_DEFINE([HAVE_BZLIB_H],1,[have bzip2]) + ;; + *) + AC_MSG_WARN([****** bzip2 support disabled]) + ;; + esac + + else + AC_MSG_WARN([****** bzip2 support disabled]) + fi +fi + +AM_CONDITIONAL([HAVE_LIBBZ2], test "x$HAVE_LIBBZ2" = "xyes") diff --git a/m4/reorganization/libs/curl.m4 b/m4/reorganization/libs/curl.m4 new file mode 100644 index 000000000..4c413cb71 --- /dev/null +++ b/m4/reorganization/libs/curl.m4 @@ -0,0 +1,40 @@ +have_curl="no" +curl_msg="Please use the web interface for submitting FPs/FNs." +AC_MSG_CHECKING([for libcurl installation]) + +AC_ARG_WITH([libcurl], +[ --with-libcurl=DIR path to directory containing libcurl (default= + /usr/local or /usr if not found in /usr/local)], +[ +if test "$withval"; then + LIBCURL_HOME="$withval" +fi +], [ +LIBCURL_HOME=/usr/local +if test ! -f "$LIBCURL_HOME/include/curl/curl.h" +then + LIBCURL_HOME=/usr +fi +AC_MSG_RESULT([$LIBCURL_HOME]) +]) + +if test ! -f "$LIBCURL_HOME/include/curl/curl.h" +then + AC_MSG_WARN([libcurl not found. Please use the web interface for submitting FPs/FNs.]) +else + if test -f "$LIBCURL_HOME/bin/curl-config"; then + CURL_LDFLAGS=$($LIBCURL_HOME/bin/curl-config --libs) + CURL_CPPFLAGS=$($LIBCURL_HOME/bin/curl-config --cflags) + else + CURL_LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" + CURL_CPPFLAGS="-I$LIBCURL_HOME/include" + fi + + save_LDFLAGS="$LDFLAGS" + LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" + AC_CHECK_LIB([curl], [curl_easy_init], [curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS"], + [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])]) +fi + +AC_SUBST([CLAMSUBMIT_LIBS]) +AC_SUBST([CLAMSUBMIT_CFLAGS]) diff --git a/m4/reorganization/libs/libconfig.m4 b/m4/reorganization/libs/libconfig.m4 new file mode 100644 index 000000000..2581b5300 --- /dev/null +++ b/m4/reorganization/libs/libconfig.m4 @@ -0,0 +1,51 @@ +dnl Check for libconfig +AC_MSG_CHECKING([for libconfig installation]) + +AC_ARG_WITH([libconfig], +[ --with-libconfig=DIR path to directory containing libconfig (default= + /usr/local or /usr if not found in /usr/local)], +[ +if test "$withval"; then + LIBCONFIG_HOME="$withval" +fi +], [ +LIBCONFIG_HOME=/usr/local +if test ! -f "$LIBCONFIG_HOME/include/libconfig.h" +then + LIBCONFIG_HOME=/usr +fi +AC_MSG_RESULT([$LIBCONFIG_HOME]) +]) + +if test ! -f "$LIBCONFIG_HOME/include/libconfig.h" +then + AC_MSG_ERROR([libconfig not found.]) +fi + +save_LDFLAGS="$LDFLAGS" +LDFLAGS="-L$LIBCONFIG_HOME/lib -lconfig" +AC_CHECK_LIB([config], [config_init], [FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$LIBCONFIG_HOME/lib -lconfig"], + [AC_MSG_ERROR([Your libconfig installation is misconfigured])]) + +CLAMSCAN_LIBS="$CLAMSCAN_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMD_LIBS="$CLAMD_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMMEM_LIBS="$CLAMMEM_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMDTOP_LIBS="$CLAMDTOP_LIBS -L$LIBCONFIG_HOME/lib -lconfig" +CLAMBC_LIBS="$CLAMBC_LIBS -L$LIBCONFIG_HOME/lib -lconfig" + +CLAMSCAN_CPPFLAGS="$FRESHCLAM_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMDSCAN_CPPFLAGS="$CLAMDSCAN_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMD_CPPFLAGS="$CLAMD_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMMEM_CPPFLAGS="$CLAMMEM_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMAV_MILTER_CPPFLAGS="$CLAMAV_MILTER_CPPFLAGS -I$LIBCONFIG_HOME/include" +LIBCLAMAV_CPPFLAGS="$LIBCLAMAV_CPPFLAGS -I$LIBCONFIG_HOME/include" +LIBCLAMSHARED_CPPFLAGS="$LIBCLAMSHARED_CPPFLAGS -I$LIBCONFIG_HOME/include" +SIGTOOL_CPPFLAGS="$SIGTOOL_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMCONF_CPPFLAGS="$CLAMCONF_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMDTOP_CPPFLAGS="$CLAMDTOP_CPPFLAGS -I$LIBCONFIG_HOME/include" +CLAMBC_CPPFLAGS="$CLAMBC_CPPFLAGS -I$LIBCONFIG_HOME/include" + +LDFLAGS="$save_ldflags" diff --git a/m4/reorganization/libs/libz.m4 b/m4/reorganization/libs/libz.m4 new file mode 100644 index 000000000..116e6940a --- /dev/null +++ b/m4/reorganization/libs/libz.m4 @@ -0,0 +1,60 @@ + +dnl Check for zlib +AC_MSG_CHECKING([for zlib installation]) +AC_ARG_WITH([zlib], +[ --with-zlib=DIR path to directory containing zlib library (default= + /usr/local or /usr if not found in /usr/local)], +[ +if test "$withval"; then + ZLIB_HOME="$withval" + AC_MSG_RESULT([using $ZLIB_HOME]) +fi +], [ +ZLIB_HOME=/usr/local +if test ! -f "$ZLIB_HOME/include/zlib.h" +then + ZLIB_HOME=/usr +fi +AC_MSG_RESULT([$ZLIB_HOME]) +]) + +CLAMDSCAN_LIBS="$FRESHCLAM_LIBS" + +AC_ARG_ENABLE([zlib-vcheck], +[ --disable-zlib-vcheck do not check for buggy zlib version ], +zlib_check=$enableval, zlib_check="yes") + +if test ! -f "$ZLIB_HOME/include/zlib.h" +then + AC_MSG_ERROR([Please install zlib and zlib-devel packages]) +else + + vuln=`grep "ZLIB_VERSION \"1.2.0" $ZLIB_HOME/include/zlib.h` + if test -z "$vuln"; then + vuln=`grep "ZLIB_VERSION \"1.2.1" $ZLIB_HOME/include/zlib.h` + fi + + if test -n "$vuln"; then + if test "$zlib_check" = "yes"; then + AC_MSG_ERROR(The installed zlib version may contain a security bug. Please upgrade to 1.2.2 or later: http://www.zlib.net. You can omit this check with --disable-zlib-vcheck but DO NOT REPORT any stability issues then!) + else + AC_MSG_WARN([****** This ClamAV installation may be linked against]) + AC_MSG_WARN([****** a broken zlib version. Please DO NOT report any]) + AC_MSG_WARN([****** stability problems to the ClamAV developers!]) + fi + fi + + save_LIBS="$LIBS" + if test "$ZLIB_HOME" != "/usr"; then + CPPFLAGS="$CPPFLAGS -I$ZLIB_HOME/include" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$ZLIB_HOME/lib" + AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$ZLIB_HOME/lib -lz"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$ZLIB_HOME/lib -lz"], AC_MSG_ERROR([Please install zlib and zlib-devel packages])) + AC_CHECK_LIB([z], [gzopen], [], AC_MSG_ERROR([Your zlib is missing gzopen()])) + LDFLAGS="$save_LDFLAGS" + else + AC_CHECK_LIB([z], [inflateEnd], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lz";FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lz"], AC_MSG_ERROR([Please install zlib and zlib-devel packages])) + AC_CHECK_LIB([z], [gzopen],[], AC_MSG_ERROR([Your zlib is missing gzopen()])) + fi + LIBS="$save_LIBS" +fi diff --git a/m4/reorganization/libs/openssl.m4 b/m4/reorganization/libs/openssl.m4 new file mode 100644 index 000000000..e0b9dc86a --- /dev/null +++ b/m4/reorganization/libs/openssl.m4 @@ -0,0 +1,37 @@ +dnl Check for OpenSSL +AC_MSG_CHECKING([for OpenSSL installation]) + +AC_ARG_WITH([openssl], +[ --with-openssl=DIR path to directory containing openssl (default= + /usr/local or /usr if not found in /usr/local)], +[ +if test "$withval"; then + LIBSSL_HOME="$withval" +fi +], [ +LIBSSL_HOME=/usr/local +if test ! -f "$LIBSSL_HOME/include/openssl/ssl.h" +then + LIBSSL_HOME=/usr +fi +AC_MSG_RESULT([$LIBSSL_HOME]) +]) + +if test ! -f "$LIBSSL_HOME/include/openssl/ssl.h" +then + AC_MSG_ERROR([OpenSSL not found.]) +fi + +SSL_LDFLAGS="-L$LIBSSL_HOME/lib -lssl" +SSL_CPPFLAGS="-I$LIBSSL_HOME/include" + +save_LDFLAGS="$LDFLAGS" +LDFLAGS="-L$LIBSSL_HOME/lib -lssl" +AC_CHECK_LIB([ssl], [SSL_library_init], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS $SSL_LDFLAGS"], + [AC_MSG_ERROR([Your OpenSSL is misconfigured])]) + +LDFLAGS="-L$LIBSSL_HOME/lib -lcrypto" +AC_CHECK_LIB([crypto], [EVP_EncryptInit], [LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lcrypto"], + [AC_MSG_ERROR([Your OpenSSL installation is misconfigured])]) + +LDFLAGS="$save_LDFLAGS" diff --git a/m4/reorganization/libs/unrar.m4 b/m4/reorganization/libs/unrar.m4 new file mode 100644 index 000000000..919c62694 --- /dev/null +++ b/m4/reorganization/libs/unrar.m4 @@ -0,0 +1,39 @@ +AC_ARG_ENABLE([unrar], +[ --disable-unrar don't build libclamunrar and libclamunrar_iface ], +want_unrar=$enableval, want_unrar="yes") +AM_CONDITIONAL([ENABLE_UNRAR],[test "$want_unrar" = "yes"]) + +AC_ARG_ENABLE([getaddrinfo], +[ --disable-getaddrinfo disable support for getaddrinfo], +want_getaddrinfo=$enableval, want_getaddrinfo="yes") + +if test "$want_getaddrinfo" = "yes" +then + AC_MSG_CHECKING([for getaddrinfo]) + AC_CACHE_VAL([have_cv_gai],[ + AC_TRY_RUN([ + #include + #include + #include + #include + int main(int argc, char **argv) + { + struct addrinfo *res; + int sd; + + if(getaddrinfo("127.0.0.1", NULL, NULL, &res) < 0) + return 1; + freeaddrinfo(res); + + return 0; + } + ], + [have_cv_gai=yes], + [have_cv_gai=no], + [have_cv_gai=no]) + ]) + AC_MSG_RESULT([$have_cv_gai]) + if test "$have_cv_gai" = yes; then + AC_DEFINE(HAVE_GETADDRINFO, 1, [have getaddrinfo()]) + fi +fi diff --git a/m4/reorganization/libs/xml.m4 b/m4/reorganization/libs/xml.m4 new file mode 100644 index 000000000..475d2d64d --- /dev/null +++ b/m4/reorganization/libs/xml.m4 @@ -0,0 +1,95 @@ + +want_xml="auto" +AC_ARG_ENABLE([xml], +[ --disable-xml disable DMG and XAR support], +want_xml=$enableval, want_xml="auto") + +XML_HOME="" +if test "X$want_xml" != "Xno"; then + AC_MSG_CHECKING([for libxml2 installation]) + AC_ARG_WITH([xml], + [ --with-xml=DIR path to directory containing libxml2 library (default= + /usr/local or /usr if not found in /usr/local)], + [ + if test "$withval" + then + XML_HOME="$withval" + AC_MSG_RESULT([using $XML_HOME]) + else + AC_MSG_ERROR([cannot assign blank value to --with-xml]) + fi + ], [ + XML_HOME=/usr/local + if test ! -x "$XML_HOME/bin/xml2-config" + then + XML_HOME=/usr + if test ! -x "$XML_HOME/bin/xml2-config" + then + XML_HOME="" + fi + fi + if test "x$XML_HOME" != "x"; then + AC_MSG_RESULT([$XML_HOME]) + else + AC_MSG_RESULT([not found]) + fi + ]) +fi + +found_xml="no" +XMLCONF_VERSION="" +XML_CPPFLAGS="" +XML_LIBS="" +if test "x$XML_HOME" != "x"; then + AC_MSG_CHECKING([xml2-config version]) + XMLCONF_VERSION="`$XML_HOME/bin/xml2-config --version`" + if test "x%XMLCONF_VERSION" != "x"; then + AC_MSG_RESULT([$XMLCONF_VERSION]) + found_xml="yes" + XML_CPPFLAGS="`$XML_HOME/bin/xml2-config --cflags`" + XML_LIBS="`$XML_HOME/bin/xml2-config --libs`" + else + AC_MSG_ERROR([xml2-config failed]) + fi +fi + +working_xml="no" +if test "X$found_xml" != "Xno"; then + AC_MSG_CHECKING([for xmlreader.h in $XML_HOME]) + + if test ! -f "$XML_HOME/include/libxml2/libxml/xmlreader.h"; then + AC_MSG_RESULT([not found]) + else + AC_MSG_RESULT([found]) + save_LIBS="$LIBS" + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $XML_LIBS" + + AC_CHECK_LIB([xml2], [xmlTextReaderRead], [working_xml="yes"], [working_xml="no"]) + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + fi +fi + +if test "$working_xml" = "yes"; then + AC_DEFINE([HAVE_LIBXML2],1,[Define to 1 if you have the 'libxml2' library (-lxml2).]) + AC_SUBST(XML_CPPFLAGS) + AC_SUBST(XML_LIBS) + AC_MSG_NOTICE([Compiling and linking with libxml2 from $XML_HOME]) +else + if test "$want_xml" = "yes"; then + AC_MSG_ERROR([****** Please install libxml2 packages!]) + else + if test "$want_xml" != "no"; then + AC_MSG_NOTICE([****** libxml2 support unavailable]) + fi + fi + XML_CPPFLAGS="" + XML_LIBS="" + AC_SUBST(XML_CPPFLAGS) + AC_SUBST(XML_LIBS) +fi diff --git a/m4/reorganization/linker_checks.m4 b/m4/reorganization/linker_checks.m4 new file mode 100644 index 000000000..c667ec2a8 --- /dev/null +++ b/m4/reorganization/linker_checks.m4 @@ -0,0 +1,47 @@ +dnl Linker feature checks +dnl check for version script support in the linker (GNU ld, or Solaris ld style) +AC_CACHE_CHECK([for ld --version-script], [ac_cv_ld_version_script], [dnl + cat > conftest.c < conftest.map <&AS_MESSAGE_LOG_FD]); + then + VERSIONSCRIPTFLAG=--version-script + ac_cv_ld_version_script=yes + else + dnl check for Solaris ld style linker version script + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $pic_flag $LDFLAGS -shared + -o conftest.so conftest.c + -Wl,-M,conftest.map + 1>&AS_MESSAGE_LOG_FD]); + then + VERSIONSCRIPTFLAG=-M + ac_cv_ld_version_script=yes; + else + ac_cv_ld_version_script=no + fi + fi + rm -f conftest*]) +AC_SUBST([VERSIONSCRIPTFLAG]) +AM_CONDITIONAL([VERSIONSCRIPT], test "x$ac_cv_ld_version_script" = "xyes") diff --git a/m4/reorganization/llvm.m4 b/m4/reorganization/llvm.m4 new file mode 100644 index 000000000..d82668b09 --- /dev/null +++ b/m4/reorganization/llvm.m4 @@ -0,0 +1,8 @@ +AC_ARG_ENABLE([llvm],AC_HELP_STRING([--enable-llvm], + [Enable 'llvm' JIT/verifier support @<:@default=auto@:>@]), + [enable_llvm=$enableval], [enable_llvm="auto"]) + +if test "$enable_llvm" != "no"; then + dnl Try to configure subdir, optionally + AC_CONFIG_SUBDIRS_OPTIONAL([libclamav/c++]) +fi diff --git a/m4/reorganization/milter/check.m4 b/m4/reorganization/milter/check.m4 new file mode 100644 index 000000000..8e30185f4 --- /dev/null +++ b/m4/reorganization/milter/check.m4 @@ -0,0 +1,29 @@ +dnl --enable-milter +if test "$have_milter" = "yes"; then + dnl libmilter checking code adapted from spamass-milter by + dnl Tom G. Christensen + + dnl Check for libmilter and it's header files in the usual locations + save_LIBS="$LIBS" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lpthread" + if test -d /usr/lib/libmilter ; then + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L/usr/lib/libmilter" + fi + LIBS="$LIBS -lmilter $CLAMAV_MILTER_LIBS" + AC_CHECK_LIB([milter],[mi_stop],[CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_LIBS"],[ + dnl Older sendmails require libsm or libsmutil for support functions + AC_SEARCH_LIBS([strlcpy], [sm smutil], [test "$ac_cv_search_strlcpy" = "none required" || CLAMAV_MILTER_XLIB="$ac_cv_search_strlcpy"]) + LIBS="$save_LIBS $CLAMAV_MILTER_LIBS $CLAMAV_MILTER_XLIB" + $as_unset ac_cv_lib_milter_mi_stop + AC_CHECK_LIB([milter],[mi_stop],[CLAMAV_MILTER_LIBS="-lmilter $CLAMAV_MILTER_XLIB $CLAMAV_MILTER_LIBS"],[ + AC_MSG_ERROR([Cannot find libmilter]) + ]) + ]) + LIBS="$save_LIBS" + AC_CHECK_HEADERS([libmilter/mfapi.h],[have_milter="yes"],[ + AC_MSG_ERROR([Please install mfapi.h from the sendmail distribution]) + ]) +fi + +AM_CONDITIONAL([BUILD_CLAMD],[test "$have_pthreads" = "yes"]) +AM_CONDITIONAL([HAVE_MILTER],[test "$have_milter" = "yes"]) diff --git a/m4/reorganization/milter/enable.m4 b/m4/reorganization/milter/enable.m4 new file mode 100644 index 000000000..7f0050a7b --- /dev/null +++ b/m4/reorganization/milter/enable.m4 @@ -0,0 +1,3 @@ +AC_ARG_ENABLE([milter], +[ --enable-milter build clamav-milter], +have_milter=$enableval, have_milter="no") diff --git a/m4/reorganization/nocache.m4 b/m4/reorganization/nocache.m4 new file mode 100644 index 000000000..8db76a0b7 --- /dev/null +++ b/m4/reorganization/nocache.m4 @@ -0,0 +1,8 @@ +AC_ARG_ENABLE([no-cache], +[ --enable-no-cache use "Cache-Control: no-cache" in freshclam], +enable_nocache=$enableval, enable_nocache="no") + +if test "$enable_nocache" = "yes"; then + AC_DEFINE([FRESHCLAM_NO_CACHE],1,[use "Cache-Control: no-cache" in freshclam]) +fi + diff --git a/m4/reorganization/os_checks.m4 b/m4/reorganization/os_checks.m4 new file mode 100644 index 000000000..ed25c957f --- /dev/null +++ b/m4/reorganization/os_checks.m4 @@ -0,0 +1,168 @@ +case "$target_os" in +linux*) + AC_DEFINE([C_LINUX],1,[target is linux]) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + if test "$want_fanotify" = "yes"; then + AC_CHECK_HEADER([linux/fanotify.h],AC_DEFINE([FANOTIFY],1,[use fanotify]),) + fi + fi + ;; +kfreebsd*-gnu) + AC_DEFINE([C_KFREEBSD_GNU],1,[target is kfreebsd-gnu]) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + ;; +solaris*) + CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lresolv" + FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv" + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + CLAMD_LIBS="$CLAMD_LIBS -lresolv" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lresolv" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_SOLARIS],1,[os is solaris]) + ;; +freebsd[[45]]*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread -lc_r" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_BSD],1,[os is freebsd 4 or 5]) + ;; +freebsd*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lthr" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_BSD],1,[os is freebsd 6]) + ;; +dragonfly*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_BSD],1,[os is dragonfly]) + ;; +openbsd*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + CLAMD_LIBS="$CLAMD_LIBS -pthread" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -pthread" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_BSD],1,[os is OpenBSD]) + ;; +bsdi*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_BSD],1,[os is BSDI BSD/OS]) + ;; +netbsd*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + fi + AC_DEFINE([C_BSD],1,[os is NetBSD]) + ;; +bsd*) + AC_MSG_RESULT([Unknown BSD detected. Disabling thread support.]) + have_pthreads="no" + AC_DEFINE([C_BSD],1,[os is bsd flavor]) + ;; +beos*) + AC_MSG_RESULT([BeOS detected. Disabling thread support.]) + have_pthreads="no" + AC_DEFINE([C_BEOS],1,[os is beos]) + ;; +x86:Interix*) + AC_DEFINE([C_INTERIX],1,[os is Interix]) + ;; +darwin*) + AC_DEFINE([C_BSD],1,[os is bsd flavor]) + AC_DEFINE([C_DARWIN],1,[os is darwin]) + AC_DEFINE([BIND_8_COMPAT],1,[enable bind8 compatibility]) + AC_DEFINE([CLAMAUTH],1,[use ClamAuth]) + use_netinfo="yes" + ;; +os2*) + CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -lsyslog" + FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsyslog" + CLAMD_LIBS="$CLAMD_LIBS -lsyslog" + CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsyslog" + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_OS2],1,[os is OS/2]) + ;; +sco*) + dnl njh@bandsman.sco.uk: SCO Unix port + dnl FRESHCLAM_LIBS="-lsocket" + dnl CLAMD_LIBS="-lsocket" + dnl CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket" + ;; +hpux*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + AC_DEFINE([C_HPUX],1,[os is hpux]) + if test "$have_mempool" = "yes"; then + LDFLAGS="$LDFLAGS -Wl,+pd,1M" + fi + ;; +aix*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + AC_DEFINE([_THREAD_SAFE],1,[thread safe]) + fi + AC_DEFINE([C_AIX],1,[os is aix]) + ;; +*-*-osf*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-pthread" + TH_SAFE="-thread-safe" + AC_DEFINE([_POSIX_PII_SOCKET],1,[POSIX compatibility]) + fi + AC_DEFINE([C_OSF],1,[os is osf/tru64]) + ;; +nto-qnx*) + AC_DEFINE([C_QNX6],1,[os is QNX 6.x.x]) + ;; +irix*) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + LIBS="$LIBS -lgen" + AC_DEFINE([C_IRIX],1,[os is irix]) + ;; +interix*) + AC_DEFINE([C_INTERIX],1,[os is interix]) + if test "$test_clamav" = "yes"; then + if test ! -r /etc/passwd; then + test_clamav="no" + fi + fi + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + ;; +gnu*) + AC_DEFINE([C_GNU_HURD],1,[target is gnu-hurd]) + if test "$have_pthreads" = "yes"; then + THREAD_LIBS="-lpthread" + TH_SAFE="-thread-safe" + fi + ;; +*) + ;; +esac diff --git a/m4/reorganization/sha_collect.m4 b/m4/reorganization/sha_collect.m4 new file mode 100644 index 000000000..83e1f52f7 --- /dev/null +++ b/m4/reorganization/sha_collect.m4 @@ -0,0 +1,4 @@ +AC_ARG_ENABLE([sha-collector-for-internal-use], [], [enable_sha_collector="yes"], [enable_sha_collector="no"]) +if test "$enable_sha_collector" != "no"; then + AC_DEFINE([HAVE__INTERNAL__SHA_COLLECT], 1, [For internal use only - DO NOT DEFINE]) +fi diff --git a/m4/reorganization/substitutions.m4 b/m4/reorganization/substitutions.m4 new file mode 100644 index 000000000..64b1600f0 --- /dev/null +++ b/m4/reorganization/substitutions.m4 @@ -0,0 +1,24 @@ +AC_SUBST([FRESHCLAM_CPPFLAGS]) +AC_SUBST([CLAMSCAN_CPPFLAGS]) +AC_SUBST([CLAMDSCAN_CPPFLAGS]) +AC_SUBST([CLAMD_CPPFLAGS]) +AC_SUBST([CLAMMEM_CPPFLAGS]) +AC_SUBST([CLAMAV_MILTER_CPPFLAGS]) +AC_SUBST([LIBCLAMAV_CPPFLAGS]) +AC_SUBST([SIGTOOL_CPPFLAGS]) +AC_SUBST([CLAMCONF_CPPFLAGS]) +AC_SUBST([CLAMDTOP_CPPFLAGS]) +AC_SUBST([CLAMBC_CPPFLAGS]) +AC_SUBST([LIBCLAMSHARED_CPPFLAGS]) + +AC_SUBST([LIBCLAMAV_LIBS]) +AC_SUBST([CLAMD_LIBS]) +AC_SUBST([CLAMMEM_LIBS]) +AC_SUBST([CLAMAV_MILTER_LIBS]) +AC_SUBST([FRESHCLAM_LIBS]) +AC_SUBST([CLAMSCAN_LIBS]) +AC_SUBST([CLAMDSCAN_LIBS]) +AC_SUBST([TH_SAFE]) +AC_SUBST([THREAD_LIBS]) +AC_SUBST([CLAMDTOP_LIBS]) +AC_SUBST([CLAMBC_LIBS]) diff --git a/m4/reorganization/usergroup.m4 b/m4/reorganization/usergroup.m4 new file mode 100644 index 000000000..f88f3e4e0 --- /dev/null +++ b/m4/reorganization/usergroup.m4 @@ -0,0 +1,14 @@ +AC_ARG_ENABLE([yp-check], +[ --enable-yp-check use ypmatch utility instead of /etc/passwd parsing], +use_yp=$enableval, use_yp="no") + +AC_ARG_WITH([user], +[ --with-user=uid name of the clamav user (default=clamav)], +clamav_user="$withval", clamav_user="clamav") + +AC_ARG_WITH([group], +[ --with-group=gid name of the clamav group (default=clamav)], +clamav_group="$withval", clamav_group="clamav") + +AC_DEFINE_UNQUOTED([CLAMAVUSER],"$clamav_user",[name of the clamav user]) +AC_DEFINE_UNQUOTED([CLAMAVGROUP],"$clamav_group",[name of the clamav group]) diff --git a/m4/reorganization/utility_checks/id.m4 b/m4/reorganization/utility_checks/id.m4 new file mode 100644 index 000000000..147eededf --- /dev/null +++ b/m4/reorganization/utility_checks/id.m4 @@ -0,0 +1,3 @@ +AC_ARG_ENABLE([id-check], +[ --enable-id-check use id utility instead of /etc/passwd parsing], +use_id=$enableval, use_id="no") diff --git a/m4/reorganization/utility_checks/yp.m4 b/m4/reorganization/utility_checks/yp.m4 new file mode 100644 index 000000000..4e7b6bc10 --- /dev/null +++ b/m4/reorganization/utility_checks/yp.m4 @@ -0,0 +1,3 @@ +AC_ARG_ENABLE([yp-check], +[ --enable-yp-check use ypmatch utility instead of /etc/passwd parsing], +use_yp=$enableval, use_yp="no") diff --git a/m4/reorganization/version.m4 b/m4/reorganization/version.m4 new file mode 100644 index 000000000..dc77ac33c --- /dev/null +++ b/m4/reorganization/version.m4 @@ -0,0 +1,17 @@ +dnl change this on a release +VERSION="devel-`date +%Y%m%d`" +dnl VERSION="1.0rc1" + +LC_CURRENT=7 +LC_REVISION=11 +LC_AGE=1 +LIBCLAMAV_VERSION="$LC_CURRENT":"$LC_REVISION":"$LC_AGE" +AC_SUBST([LIBCLAMAV_VERSION]) + +AC_DEFINE_UNQUOTED([LIBCLAMAV_FULLVER], "$major.$LC_AGE.$LC_REVISION", + ["Full library version number"]) + +AC_DEFINE_UNQUOTED([LIBCLAMAV_MAJORVER], $major, ["Major library version number"]) + +AC_DEFINE_UNQUOTED([VERSION],"$VERSION",[Version number of package]) +AC_DEFINE_UNQUOTED([VERSION_SUFFIX],"$VERSION_SUFFIX",[Version suffix for package]) diff --git a/shared/Makefile.in b/shared/Makefile.in index ee1d20622..86527cd76 100644 --- a/shared/Makefile.in +++ b/shared/Makefile.in @@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +16,23 @@ @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@ @@ -48,7 +65,61 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ - $(top_srcdir)/configure.in + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -60,8 +131,8 @@ libshared_la_LIBADD = am_libshared_la_OBJECTS = actions.lo cdiff.lo clamdcom.lo getopt.lo \ misc.lo optparser.lo tar.lo libshared_la_OBJECTS = $(am_libshared_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent libshared_minimal_la_DEPENDENCIES = libshared.la am_libshared_minimal_la_OBJECTS = libshared_minimal_la-output.lo @@ -95,21 +166,21 @@ LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libshared_la_SOURCES) $(libshared_minimal_la_SOURCES) \ $(libshared_minimal_threads_la_SOURCES) \ @@ -119,6 +190,11 @@ DIST_SOURCES = $(libshared_la_SOURCES) $(libshared_minimal_la_SOURCES) \ $(libshared_minimal_threads_la_SOURCES) \ $(libshared_nothreads_la_SOURCES) \ $(libshared_threads_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -140,9 +216,23 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ +CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ +CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_CPPFLAGS = @CURSES_CPPFLAGS@ @@ -160,6 +250,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -181,8 +272,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -220,6 +313,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ @@ -227,6 +321,8 @@ VERSION = @VERSION@ VERSIONSCRIPTFLAG = @VERSIONSCRIPTFLAG@ WERR_CFLAGS = @WERR_CFLAGS@ WERR_CFLAGS_MILTER = @WERR_CFLAGS_MILTER@ +XML_CPPFLAGS = @XML_CPPFLAGS@ +XML_LIBS = @XML_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -354,15 +450,15 @@ clean-noinstLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libshared.la: $(libshared_la_OBJECTS) $(libshared_la_DEPENDENCIES) +libshared.la: $(libshared_la_OBJECTS) $(libshared_la_DEPENDENCIES) $(EXTRA_libshared_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libshared_la_OBJECTS) $(libshared_la_LIBADD) $(LIBS) -libshared_minimal.la: $(libshared_minimal_la_OBJECTS) $(libshared_minimal_la_DEPENDENCIES) +libshared_minimal.la: $(libshared_minimal_la_OBJECTS) $(libshared_minimal_la_DEPENDENCIES) $(EXTRA_libshared_minimal_la_DEPENDENCIES) $(AM_V_CCLD)$(libshared_minimal_la_LINK) $(libshared_minimal_la_OBJECTS) $(libshared_minimal_la_LIBADD) $(LIBS) -libshared_minimal_threads.la: $(libshared_minimal_threads_la_OBJECTS) $(libshared_minimal_threads_la_DEPENDENCIES) +libshared_minimal_threads.la: $(libshared_minimal_threads_la_OBJECTS) $(libshared_minimal_threads_la_DEPENDENCIES) $(EXTRA_libshared_minimal_threads_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libshared_minimal_threads_la_OBJECTS) $(libshared_minimal_threads_la_LIBADD) $(LIBS) -libshared_nothreads.la: $(libshared_nothreads_la_OBJECTS) $(libshared_nothreads_la_DEPENDENCIES) +libshared_nothreads.la: $(libshared_nothreads_la_OBJECTS) $(libshared_nothreads_la_DEPENDENCIES) $(EXTRA_libshared_nothreads_la_DEPENDENCIES) $(AM_V_CCLD)$(libshared_nothreads_la_LINK) $(libshared_nothreads_la_OBJECTS) $(libshared_nothreads_la_LIBADD) $(LIBS) -libshared_threads.la: $(libshared_threads_la_OBJECTS) $(libshared_threads_la_DEPENDENCIES) +libshared_threads.la: $(libshared_threads_la_OBJECTS) $(libshared_threads_la_DEPENDENCIES) $(EXTRA_libshared_threads_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libshared_threads_la_OBJECTS) $(libshared_threads_la_LIBADD) $(LIBS) mostlyclean-compile: @@ -385,55 +481,46 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tar.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libshared_minimal_la-output.lo: output.c @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) $(libshared_minimal_la_CFLAGS) $(CFLAGS) -MT libshared_minimal_la-output.lo -MD -MP -MF $(DEPDIR)/libshared_minimal_la-output.Tpo -c -o libshared_minimal_la-output.lo `test -f 'output.c' || echo '$(srcdir)/'`output.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libshared_minimal_la-output.Tpo $(DEPDIR)/libshared_minimal_la-output.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='output.c' object='libshared_minimal_la-output.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='output.c' object='libshared_minimal_la-output.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_minimal_la_CFLAGS) $(CFLAGS) -c -o libshared_minimal_la-output.lo `test -f 'output.c' || echo '$(srcdir)/'`output.c +@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) $(libshared_minimal_la_CFLAGS) $(CFLAGS) -c -o libshared_minimal_la-output.lo `test -f 'output.c' || echo '$(srcdir)/'`output.c libshared_nothreads_la-output.lo: output.c @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) $(libshared_nothreads_la_CFLAGS) $(CFLAGS) -MT libshared_nothreads_la-output.lo -MD -MP -MF $(DEPDIR)/libshared_nothreads_la-output.Tpo -c -o libshared_nothreads_la-output.lo `test -f 'output.c' || echo '$(srcdir)/'`output.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libshared_nothreads_la-output.Tpo $(DEPDIR)/libshared_nothreads_la-output.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='output.c' object='libshared_nothreads_la-output.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='output.c' object='libshared_nothreads_la-output.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_nothreads_la_CFLAGS) $(CFLAGS) -c -o libshared_nothreads_la-output.lo `test -f 'output.c' || echo '$(srcdir)/'`output.c +@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) $(libshared_nothreads_la_CFLAGS) $(CFLAGS) -c -o libshared_nothreads_la-output.lo `test -f 'output.c' || echo '$(srcdir)/'`output.c libshared_nothreads_la-misc_libclamav.lo: misc_libclamav.c @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) $(libshared_nothreads_la_CFLAGS) $(CFLAGS) -MT libshared_nothreads_la-misc_libclamav.lo -MD -MP -MF $(DEPDIR)/libshared_nothreads_la-misc_libclamav.Tpo -c -o libshared_nothreads_la-misc_libclamav.lo `test -f 'misc_libclamav.c' || echo '$(srcdir)/'`misc_libclamav.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libshared_nothreads_la-misc_libclamav.Tpo $(DEPDIR)/libshared_nothreads_la-misc_libclamav.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='misc_libclamav.c' object='libshared_nothreads_la-misc_libclamav.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='misc_libclamav.c' object='libshared_nothreads_la-misc_libclamav.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libshared_nothreads_la_CFLAGS) $(CFLAGS) -c -o libshared_nothreads_la-misc_libclamav.lo `test -f 'misc_libclamav.c' || echo '$(srcdir)/'`misc_libclamav.c +@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) $(libshared_nothreads_la_CFLAGS) $(CFLAGS) -c -o libshared_nothreads_la-misc_libclamav.lo `test -f 'misc_libclamav.c' || echo '$(srcdir)/'`misc_libclamav.c mostlyclean-libtool: -rm -f *.lo @@ -537,10 +624,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: diff --git a/sigtool/Makefile.in b/sigtool/Makefile.in index 19e57dc87..cb595db6b 100644 --- a/sigtool/Makefile.in +++ b/sigtool/Makefile.in @@ -84,6 +84,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -155,9 +209,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -177,6 +243,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -198,8 +265,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -237,6 +306,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/sigtool/sigtool.c b/sigtool/sigtool.c index 704772a74..1f46507ca 100644 --- a/sigtool/sigtool.c +++ b/sigtool/sigtool.c @@ -24,8 +24,6 @@ #include "clamav-config.h" #endif -#define _GNU_SOURCE - #include #include #include diff --git a/test/Makefile.in b/test/Makefile.in index c5666b94a..56529143d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -65,6 +65,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -104,9 +158,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -126,6 +192,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -147,8 +214,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -186,6 +255,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ diff --git a/unit_tests/Makefile.in b/unit_tests/Makefile.in index c2fc31809..89158d0b9 100644 --- a/unit_tests/Makefile.in +++ b/unit_tests/Makefile.in @@ -67,6 +67,60 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/mmap_private.m4 $(top_srcdir)/m4/resolv.m4 \ + $(top_srcdir)/m4/reorganization/version.m4 \ + $(top_srcdir)/m4/reorganization/build_tools.m4 \ + $(top_srcdir)/m4/reorganization/headers.m4 \ + $(top_srcdir)/m4/reorganization/c_options.m4 \ + $(top_srcdir)/m4/reorganization/compiler_checks.m4 \ + $(top_srcdir)/m4/reorganization/linker_checks.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/functions.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/mpool.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/unit_tests.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/coverage.m4 \ + $(top_srcdir)/m4/reorganization/libs/libz.m4 \ + $(top_srcdir)/m4/reorganization/libs/bzip.m4 \ + $(top_srcdir)/m4/reorganization/libs/unrar.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ipv6.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/dns.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/fanotify.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/setpgrp.m4 \ + $(top_srcdir)/m4/reorganization/milter/enable.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/iconv.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthreads.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/reentrant.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/id.m4 \ + $(top_srcdir)/m4/reorganization/utility_checks/yp.m4 \ + $(top_srcdir)/m4/reorganization/usergroup.m4 \ + $(top_srcdir)/m4/reorganization/debug.m4 \ + $(top_srcdir)/m4/reorganization/customversion.m4 \ + $(top_srcdir)/m4/reorganization/nocache.m4 \ + $(top_srcdir)/m4/reorganization/dns.m4 \ + $(top_srcdir)/m4/reorganization/bigstack.m4 \ + $(top_srcdir)/m4/reorganization/dbdir.m4 \ + $(top_srcdir)/m4/reorganization/cfgdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_port_t.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/in_addr_t.m4 \ + $(top_srcdir)/m4/reorganization/os_checks.m4 \ + $(top_srcdir)/m4/reorganization/milter/check.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/pthread_02.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/readdir.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/ctime.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/socklen_t.m4 \ + $(top_srcdir)/m4/reorganization/clamav_user.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/compiler_attribs.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/select.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/stat64.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/shift.m4 \ + $(top_srcdir)/m4/reorganization/code_checks/features.m4 \ + $(top_srcdir)/m4/reorganization/clamdtop.m4 \ + $(top_srcdir)/m4/reorganization/distcheck.m4 \ + $(top_srcdir)/m4/reorganization/llvm.m4 \ + $(top_srcdir)/m4/reorganization/sha_collect.m4 \ + $(top_srcdir)/m4/reorganization/bsd.m4 \ + $(top_srcdir)/m4/reorganization/libs/curl.m4 \ + $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ + $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -295,9 +349,21 @@ CHECK_CPPFLAGS = @CHECK_CPPFLAGS@ CHECK_LIBS = @CHECK_LIBS@ CLAMAVGROUP = @CLAMAVGROUP@ CLAMAVUSER = @CLAMAVUSER@ +CLAMAV_MILTER_CPPFLAGS = @CLAMAV_MILTER_CPPFLAGS@ CLAMAV_MILTER_LIBS = @CLAMAV_MILTER_LIBS@ +CLAMBC_CPPFLAGS = @CLAMBC_CPPFLAGS@ +CLAMBC_LIBS = @CLAMBC_LIBS@ +CLAMCONF_CPPFLAGS = @CLAMCONF_CPPFLAGS@ +CLAMDSCAN_CPPFLAGS = @CLAMDSCAN_CPPFLAGS@ CLAMDSCAN_LIBS = @CLAMDSCAN_LIBS@ +CLAMDTOP_CPPFLAGS = @CLAMDTOP_CPPFLAGS@ +CLAMDTOP_LIBS = @CLAMDTOP_LIBS@ +CLAMD_CPPFLAGS = @CLAMD_CPPFLAGS@ CLAMD_LIBS = @CLAMD_LIBS@ +CLAMMEM_CPPFLAGS = @CLAMMEM_CPPFLAGS@ +CLAMMEM_LIBS = @CLAMMEM_LIBS@ +CLAMSCAN_CPPFLAGS = @CLAMSCAN_CPPFLAGS@ +CLAMSCAN_LIBS = @CLAMSCAN_LIBS@ CLAMSUBMIT_CFLAGS = @CLAMSUBMIT_CFLAGS@ CLAMSUBMIT_LIBS = @CLAMSUBMIT_LIBS@ CPP = @CPP@ @@ -317,6 +383,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FRESHCLAM_CPPFLAGS = @FRESHCLAM_CPPFLAGS@ FRESHCLAM_LIBS = @FRESHCLAM_LIBS@ GCOV = @GCOV@ GENHTML = @GENHTML@ @@ -338,8 +405,10 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBBZ2 = @LIBBZ2@ LIBBZ2_PREFIX = @LIBBZ2_PREFIX@ +LIBCLAMAV_CPPFLAGS = @LIBCLAMAV_CPPFLAGS@ LIBCLAMAV_LIBS = @LIBCLAMAV_LIBS@ LIBCLAMAV_VERSION = @LIBCLAMAV_VERSION@ +LIBCLAMSHARED_CPPFLAGS = @LIBCLAMSHARED_CPPFLAGS@ LIBLTDL = @LIBLTDL@ LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ @@ -377,6 +446,7 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIGTOOL_CPPFLAGS = @SIGTOOL_CPPFLAGS@ STRIP = @STRIP@ THREAD_LIBS = @THREAD_LIBS@ TH_SAFE = @TH_SAFE@ From b2e7c931d0bf8a37fe34470564766580d56b408c Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Sat, 8 Feb 2014 00:31:12 -0500 Subject: [PATCH 2/7] Use OpenSSL for hashing. --- Makefile.in | 1 + clamav-milter/Makefile.in | 1 + clambc/Makefile.in | 1 + clambc/bcrun.c | 5 + clamconf/Makefile.in | 1 + clamconf/clamconf.c | 4 + clamd/Makefile.in | 1 + clamd/clamd.c | 4 + clamd/fan.c | 4 + clamd/others.c | 4 + clamd/scanner.c | 4 + clamd/server-th.c | 4 + clamd/session.c | 4 + clamd/thrmgr.c | 4 + clamdscan/Makefile.in | 1 + clamdscan/client.c | 4 + clamdscan/proto.c | 4 + clamdtop/Makefile.in | 1 + clamscan/Makefile.in | 1 + clamscan/clamscan.c | 4 + clamscan/manager.c | 4 + clamsubmit/Makefile.in | 1 + clamsubmit/clamsubmit.c | 4 + configure | 127 ++++ configure.ac | 3 + database/Makefile.in | 1 + docs/Makefile.in | 1 + etc/Makefile.in | 1 + freshclam/Makefile.in | 1 + freshclam/freshclam.c | 4 + freshclam/manager.c | 5 +- libclamav/7z/7zCrc.c | 4 + libclamav/7z/7zCrcOpt.c | 4 + libclamav/7z/7zDec.c | 4 + libclamav/7z/7zIn.c | 4 + libclamav/7z/CpuArch.c | 4 + libclamav/7z/Ppmd7.c | 4 + libclamav/7z/Ppmd7Dec.c | 4 + libclamav/7z/Sha256.h | 35 - libclamav/7z/Xz.c | 10 +- libclamav/7z/Xz.h | 8 +- libclamav/7z/XzDec.c | 16 +- libclamav/7z/XzIn.c | 4 + libclamav/7z_iface.c | 4 + libclamav/Makefile.am | 24 +- libclamav/Makefile.in | 107 ++-- libclamav/adc.c | 4 + libclamav/asn1.c | 70 +- libclamav/aspack.c | 5 + libclamav/autoit.c | 4 + libclamav/binhex.c | 4 + libclamav/blob.c | 4 + libclamav/bytecode.c | 7 +- libclamav/bytecode_api.c | 5 + libclamav/bytecode_detect.c | 5 + libclamav/bytecode_nojit.c | 5 + libclamav/bytecode_vm.c | 5 + libclamav/c++/bytecode2llvm.cpp | 19 +- libclamav/cab.c | 4 + libclamav/cache.c | 41 +- libclamav/chmunpack.c | 4 + libclamav/conv.c | 189 ++++++ libclamav/conv.h | 27 + libclamav/cpio.c | 4 + libclamav/crtmgr.c | 4 + libclamav/crtmgr.h | 1 - libclamav/crypto.c | 1021 ++++++++++++++++++++++++++++++ libclamav/crypto.h | 277 ++++++++ libclamav/cvd.c | 14 +- libclamav/cvd.h | 4 +- libclamav/dconf.c | 4 + libclamav/disasm.c | 4 + libclamav/dlp.c | 4 + libclamav/dmg.c | 4 + libclamav/dsig.c | 33 +- libclamav/elf.c | 4 + libclamav/entconv.c | 4 + libclamav/events.c | 12 +- libclamav/explode.c | 4 + libclamav/filetypes.c | 4 + libclamav/filtering.c | 5 + libclamav/fmap.c | 4 + libclamav/fpu.c | 4 + libclamav/fsg.c | 4 + libclamav/gpt.c | 4 + libclamav/hashtab.c | 4 + libclamav/hfsplus.c | 4 + libclamav/hostid.c | 13 +- libclamav/htmlnorm.c | 4 + libclamav/inflate64.c | 4 + libclamav/is_tar.c | 4 + libclamav/ishield.c | 4 + libclamav/iso9660.c | 5 + libclamav/jpeg.c | 4 + libclamav/json.c | 4 + libclamav/jsparse/js-norm.c | 4 + libclamav/libclamav.map | 36 +- libclamav/line.c | 4 + libclamav/lzma_iface.c | 4 + libclamav/macho.c | 4 + libclamav/matcher-ac.c | 4 + libclamav/matcher-bm.c | 5 + libclamav/matcher-hash.c | 10 +- libclamav/matcher.c | 544 +++++++++------- libclamav/mbox.c | 20 +- libclamav/md5.c | 284 --------- libclamav/md5.h | 30 - libclamav/message.c | 4 + libclamav/mew.c | 4 + libclamav/mpool.c | 4 + libclamav/msexpand.c | 4 + libclamav/mspack.c | 4 + libclamav/nsis/bzlib.c | 4 + libclamav/nsis/nulsft.c | 4 + libclamav/ole2_extract.c | 4 + libclamav/others.c | 72 +-- libclamav/others_common.c | 12 +- libclamav/packlibs.c | 4 + libclamav/pdf.c | 65 +- libclamav/pe.c | 66 +- libclamav/pe_icons.c | 4 + libclamav/petite.c | 4 + libclamav/phish_domaincheck_db.c | 4 + libclamav/phish_whitelist.c | 4 + libclamav/phishcheck.c | 21 +- libclamav/png.c | 4 + libclamav/qsort.c | 4 + libclamav/readdb.c | 51 +- libclamav/rebuildpe.c | 4 + libclamav/regex/regcomp.c | 5 + libclamav/regex/regerror.c | 5 + libclamav/regex/regexec.c | 5 + libclamav/regex/regfree.c | 5 + libclamav/regex_list.c | 4 +- libclamav/regex_suffix.c | 4 + libclamav/rtf.c | 4 + libclamav/scanners.c | 6 + libclamav/sha1.c | 626 ------------------ libclamav/sha1.h | 66 -- libclamav/sha256.c | 480 -------------- libclamav/sha256.h | 66 -- libclamav/sis.c | 4 + libclamav/special.c | 5 + libclamav/spin.c | 4 + libclamav/stats.c | 4 + libclamav/str.c | 4 + libclamav/swf.c | 4 + libclamav/table.c | 4 + libclamav/text.c | 4 + libclamav/textdet.c | 4 + libclamav/tnef.c | 4 + libclamav/unarj.c | 4 + libclamav/uniq.c | 15 +- libclamav/unsp.c | 4 + libclamav/untar.c | 4 + libclamav/unzip.c | 4 + libclamav/upack.c | 4 + libclamav/upx.c | 4 + libclamav/uuencode.c | 5 + libclamav/vba_extract.c | 4 + libclamav/wwunpack.c | 4 + libclamav/www.c | 4 + libclamav/xar.c | 47 +- libclamav/xz_iface.c | 5 +- libclamav/yc.c | 5 + libltdl/Makefile.in | 1 + shared/Makefile.in | 1 + shared/cdiff.c | 15 +- shared/misc.c | 4 + shared/optparser.c | 4 + shared/output.c | 4 + sigtool/Makefile.in | 1 + sigtool/sigtool.c | 35 +- sigtool/vba.c | 4 + test/Makefile.in | 1 + unit_tests/Makefile.in | 1 + unit_tests/check_bytecode.c | 5 + unit_tests/check_clamav.c | 22 +- unit_tests/check_disasm.c | 4 + unit_tests/check_htmlnorm.c | 5 + unit_tests/check_jsnorm.c | 5 + unit_tests/check_matchers.c | 4 + unit_tests/check_regex.c | 5 + unit_tests/check_str.c | 5 + 184 files changed, 2960 insertions(+), 2216 deletions(-) delete mode 100755 libclamav/7z/Sha256.h create mode 100644 libclamav/conv.c create mode 100644 libclamav/conv.h create mode 100644 libclamav/crypto.c create mode 100644 libclamav/crypto.h delete mode 100644 libclamav/md5.c delete mode 100644 libclamav/md5.h delete mode 100644 libclamav/sha1.c delete mode 100644 libclamav/sha1.h delete mode 100644 libclamav/sha256.c delete mode 100644 libclamav/sha256.h diff --git a/Makefile.in b/Makefile.in index 65f061c2d..662802a93 100644 --- a/Makefile.in +++ b/Makefile.in @@ -156,6 +156,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clamav-milter/Makefile.in b/clamav-milter/Makefile.in index f94e61f4b..6bd39d5ef 100644 --- a/clamav-milter/Makefile.in +++ b/clamav-milter/Makefile.in @@ -138,6 +138,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clambc/Makefile.in b/clambc/Makefile.in index cbc23f405..df074d35b 100644 --- a/clambc/Makefile.in +++ b/clambc/Makefile.in @@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clambc/bcrun.c b/clambc/bcrun.c index 22e173761..4a810f6ef 100644 --- a/clambc/bcrun.c +++ b/clambc/bcrun.c @@ -27,6 +27,11 @@ #include #endif #include + +#include +#include +#include "libclamav/crypto.h" + #include "bytecode.h" #include "bytecode_priv.h" #include "clamav.h" diff --git a/clamconf/Makefile.in b/clamconf/Makefile.in index 17196e0a8..021cd2626 100644 --- a/clamconf/Makefile.in +++ b/clamconf/Makefile.in @@ -137,6 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clamconf/clamconf.c b/clamconf/clamconf.c index 543d02cf8..9d9f6f292 100644 --- a/clamconf/clamconf.c +++ b/clamconf/clamconf.c @@ -35,6 +35,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "shared/optparser.h" #include "shared/misc.h" diff --git a/clamd/Makefile.in b/clamd/Makefile.in index 4d42f16e7..6c92e8ddb 100644 --- a/clamd/Makefile.in +++ b/clamd/Makefile.in @@ -137,6 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clamd/clamd.c b/clamd/clamd.c index e1e0b64c4..2024c0430 100644 --- a/clamd/clamd.c +++ b/clamd/clamd.c @@ -53,6 +53,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "target.h" #include "libclamav/clamav.h" diff --git a/clamd/fan.c b/clamd/fan.c index e4ec5a367..9b2dccb90 100644 --- a/clamd/fan.c +++ b/clamd/fan.c @@ -34,6 +34,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include #include "fan-syscalllib.h" #include "fan.h" diff --git a/clamd/others.c b/clamd/others.c index 979a2f674..16ad64664 100644 --- a/clamd/others.c +++ b/clamd/others.c @@ -65,6 +65,10 @@ #endif /* HAVE_POLL_H */ #endif /* HAVE_POLL */ +#include +#include +#include "libclamav/crypto.h" + #include #include "shared/optparser.h" #include "shared/output.h" diff --git a/clamd/scanner.c b/clamd/scanner.c index 172b9b8b4..06e2d1d35 100644 --- a/clamd/scanner.c +++ b/clamd/scanner.c @@ -49,6 +49,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "libclamav/clamav.h" #include "libclamav/others.h" #include "libclamav/scanners.h" diff --git a/clamd/server-th.c b/clamd/server-th.c index 86a3a48eb..274baba06 100644 --- a/clamd/server-th.c +++ b/clamd/server-th.c @@ -40,6 +40,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include #ifdef C_SOLARIS #include diff --git a/clamd/session.c b/clamd/session.c index 8d631ccb1..48e5a7287 100644 --- a/clamd/session.c +++ b/clamd/session.c @@ -49,6 +49,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "libclamav/clamav.h" #include "libclamav/str.h" #include "libclamav/others.h" diff --git a/clamd/thrmgr.c b/clamd/thrmgr.c index 2aff6eb2b..6506564ec 100644 --- a/clamd/thrmgr.c +++ b/clamd/thrmgr.c @@ -29,6 +29,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "shared/output.h" #include "thrmgr.h" diff --git a/clamdscan/Makefile.in b/clamdscan/Makefile.in index 38e06ba3d..f62392732 100644 --- a/clamdscan/Makefile.in +++ b/clamdscan/Makefile.in @@ -137,6 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clamdscan/client.c b/clamdscan/client.c index 87902495c..13cd9b333 100644 --- a/clamdscan/client.c +++ b/clamdscan/client.c @@ -52,6 +52,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "shared/optparser.h" #include "shared/output.h" #include "shared/misc.h" diff --git a/clamdscan/proto.c b/clamdscan/proto.c index 45306be0d..c1ef8c67a 100644 --- a/clamdscan/proto.c +++ b/clamdscan/proto.c @@ -43,6 +43,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "libclamav/others.h" #include "shared/actions.h" #include "shared/output.h" diff --git a/clamdtop/Makefile.in b/clamdtop/Makefile.in index 6672d5e07..351d0e393 100644 --- a/clamdtop/Makefile.in +++ b/clamdtop/Makefile.in @@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clamscan/Makefile.in b/clamscan/Makefile.in index d6b94aa4f..8b96463cf 100644 --- a/clamscan/Makefile.in +++ b/clamscan/Makefile.in @@ -138,6 +138,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clamscan/clamscan.c b/clamscan/clamscan.c index a6e25b18c..1607d4513 100644 --- a/clamscan/clamscan.c +++ b/clamscan/clamscan.c @@ -38,6 +38,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "global.h" #include "manager.h" diff --git a/clamscan/manager.c b/clamscan/manager.c index cb6c95118..4fa6728d1 100644 --- a/clamscan/manager.c +++ b/clamscan/manager.c @@ -48,6 +48,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "manager.h" #include "global.h" diff --git a/clamsubmit/Makefile.in b/clamsubmit/Makefile.in index e7a835e85..ec90fd299 100644 --- a/clamsubmit/Makefile.in +++ b/clamsubmit/Makefile.in @@ -137,6 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/clamsubmit/clamsubmit.c b/clamsubmit/clamsubmit.c index 3b8f6ce90..ff475eb3f 100644 --- a/clamsubmit/clamsubmit.c +++ b/clamsubmit/clamsubmit.c @@ -3,6 +3,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include #include "libclamav/clamav.h" diff --git a/configure b/configure index ca06a1e65..f27e5867f 100755 --- a/configure +++ b/configure @@ -906,6 +906,7 @@ with_libcurl with_libconfig enable_xml with_xml +with_openssl ' ac_precious_vars='build_alias host_alias @@ -1612,6 +1613,8 @@ Optional Packages: /usr/local or /usr if not found in /usr/local) --with-xml=DIR path to directory containing libxml2 library (default= /usr/local or /usr if not found in /usr/local) + --with-openssl=DIR path to directory containing openssl (default= + /usr/local or /usr if not found in /usr/local) Some influential environment variables: CC C compiler command @@ -21592,6 +21595,7 @@ CLAMBC_CPPFLAGS="$CLAMBC_CPPFLAGS -I$LIBCONFIG_HOME/include" LDFLAGS="$save_ldflags" + want_xml="auto" # Check whether --enable-xml was given. if test "${enable_xml+set}" = set; then : @@ -21749,6 +21753,129 @@ $as_echo "$as_me: ****** libxml2 support unavailable" >&6;} fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenSSL installation" >&5 +$as_echo_n "checking for OpenSSL installation... " >&6; } + + +# Check whether --with-openssl was given. +if test "${with_openssl+set}" = set; then : + withval=$with_openssl; +if test "$withval"; then + LIBSSL_HOME="$withval" +fi + +else + +LIBSSL_HOME=/usr/local +if test ! -f "$LIBSSL_HOME/include/openssl/ssl.h" +then + LIBSSL_HOME=/usr +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSSL_HOME" >&5 +$as_echo "$LIBSSL_HOME" >&6; } + +fi + + +if test ! -f "$LIBSSL_HOME/include/openssl/ssl.h" +then + as_fn_error $? "OpenSSL not found." "$LINENO" 5 +fi + +SSL_LDFLAGS="-L$LIBSSL_HOME/lib -lssl" +SSL_CPPFLAGS="-I$LIBSSL_HOME/include" + +save_LDFLAGS="$LDFLAGS" +LDFLAGS="-L$LIBSSL_HOME/lib -lssl" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5 +$as_echo_n "checking for SSL_library_init in -lssl... " >&6; } +if ${ac_cv_lib_ssl_SSL_library_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char SSL_library_init (); +int +main () +{ +return SSL_library_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ssl_SSL_library_init=yes +else + ac_cv_lib_ssl_SSL_library_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5 +$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; } +if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then : + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS $SSL_LDFLAGS" +else + as_fn_error $? "Your OpenSSL is misconfigured" "$LINENO" 5 +fi + + +LDFLAGS="-L$LIBSSL_HOME/lib -lcrypto" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_EncryptInit in -lcrypto" >&5 +$as_echo_n "checking for EVP_EncryptInit in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_EVP_EncryptInit+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char EVP_EncryptInit (); +int +main () +{ +return EVP_EncryptInit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_EVP_EncryptInit=yes +else + ac_cv_lib_crypto_EVP_EncryptInit=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_EncryptInit" >&5 +$as_echo "$ac_cv_lib_crypto_EVP_EncryptInit" >&6; } +if test "x$ac_cv_lib_crypto_EVP_EncryptInit" = xyes; then : + LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lcrypto" +else + as_fn_error $? "Your OpenSSL installation is misconfigured" "$LINENO" 5 +fi + + +LDFLAGS="$save_LDFLAGS" + diff --git a/configure.ac b/configure.ac index 1ce6fe94d..bb1ed68c5 100644 --- a/configure.ac +++ b/configure.ac @@ -123,7 +123,10 @@ m4_include([m4/reorganization/bsd.m4]) dnl Freshclam dependencies m4_include([m4/reorganization/libs/curl.m4]) m4_include([m4/reorganization/libs/libconfig.m4]) + +dnl libclamav dependencies m4_include([m4/reorganization/libs/xml.m4]) +m4_include([m4/reorganization/libs/openssl.m4]) m4_include([m4/reorganization/substitutions.m4]) diff --git a/database/Makefile.in b/database/Makefile.in index fc62910c7..f135a4457 100644 --- a/database/Makefile.in +++ b/database/Makefile.in @@ -136,6 +136,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/docs/Makefile.in b/docs/Makefile.in index cd470bbfe..1dcc21b6c 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -135,6 +135,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/etc/Makefile.in b/etc/Makefile.in index 6c9a0d2a8..c188fa9b9 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -137,6 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/freshclam/Makefile.in b/freshclam/Makefile.in index 587c97ac5..95cc6604f 100644 --- a/freshclam/Makefile.in +++ b/freshclam/Makefile.in @@ -138,6 +138,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/freshclam/freshclam.c b/freshclam/freshclam.c index 7c7e21ad3..e50335fe8 100644 --- a/freshclam/freshclam.c +++ b/freshclam/freshclam.c @@ -46,6 +46,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "target.h" #include "clamav.h" #include "freshclamcodes.h" diff --git a/freshclam/manager.c b/freshclam/manager.c index 3008bac3d..4a15f6185 100644 --- a/freshclam/manager.c +++ b/freshclam/manager.c @@ -30,7 +30,6 @@ * fails on Solaris because it would require a c99 compiler, * 500 fails completely on Solaris, and FreeBSD, and w/o _XOPEN_SOURCE * strptime is not defined on Linux */ -#define _GNU_SOURCE #define __EXTENSIONS #include @@ -61,6 +60,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "target.h" #include "freshclamcodes.h" diff --git a/libclamav/7z/7zCrc.c b/libclamav/7z/7zCrc.c index 4b6cc68cf..344a43165 100644 --- a/libclamav/7z/7zCrc.c +++ b/libclamav/7z/7zCrc.c @@ -1,6 +1,10 @@ /* 7zCrc.c -- CRC32 calculation 2009-11-23 : Igor Pavlov : Public domain */ +#include +#include +#include "libclamav/crypto.h" + #include "7zCrc.h" #include "CpuArch.h" diff --git a/libclamav/7z/7zCrcOpt.c b/libclamav/7z/7zCrcOpt.c index 6205d7161..0d9b2c46c 100755 --- a/libclamav/7z/7zCrcOpt.c +++ b/libclamav/7z/7zCrcOpt.c @@ -1,6 +1,10 @@ /* 7zCrcOpt.c -- CRC32 calculation : optimized version 2009-11-23 : Igor Pavlov : Public domain */ +#include +#include +#include "libclamav/crypto.h" + #include "CpuArch.h" #ifdef MY_CPU_LE diff --git a/libclamav/7z/7zDec.c b/libclamav/7z/7zDec.c index b2aab4eb5..7022c4730 100644 --- a/libclamav/7z/7zDec.c +++ b/libclamav/7z/7zDec.c @@ -3,6 +3,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #define _7ZIP_PPMD_SUPPPORT #include "7z.h" diff --git a/libclamav/7z/7zIn.c b/libclamav/7z/7zIn.c index ea2ed95ac..3bb0a9a23 100644 --- a/libclamav/7z/7zIn.c +++ b/libclamav/7z/7zIn.c @@ -3,6 +3,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "7z.h" #include "7zCrc.h" #include "CpuArch.h" diff --git a/libclamav/7z/CpuArch.c b/libclamav/7z/CpuArch.c index 36e7680d9..e4841ea25 100755 --- a/libclamav/7z/CpuArch.c +++ b/libclamav/7z/CpuArch.c @@ -1,6 +1,10 @@ /* CpuArch.c -- CPU specific code 2010-10-26: Igor Pavlov : Public domain */ +#include +#include +#include "libclamav/crypto.h" + #include "CpuArch.h" #ifdef MY_CPU_X86_OR_AMD64 diff --git a/libclamav/7z/Ppmd7.c b/libclamav/7z/Ppmd7.c index c9342644b..173b8d1f2 100644 --- a/libclamav/7z/Ppmd7.c +++ b/libclamav/7z/Ppmd7.c @@ -4,6 +4,10 @@ This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ #include +#include +#include +#include "libclamav/crypto.h" + #include "Ppmd7.h" const Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 }; diff --git a/libclamav/7z/Ppmd7Dec.c b/libclamav/7z/Ppmd7Dec.c index 68438d5ce..f85ef4076 100644 --- a/libclamav/7z/Ppmd7Dec.c +++ b/libclamav/7z/Ppmd7Dec.c @@ -2,6 +2,10 @@ 2010-03-12 : Igor Pavlov : Public domain This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */ +#include +#include +#include "libclamav/crypto.h" + #include "Ppmd7.h" #define kTopValue (1 << 24) diff --git a/libclamav/7z/Sha256.h b/libclamav/7z/Sha256.h deleted file mode 100755 index 27e1f848f..000000000 --- a/libclamav/7z/Sha256.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Sha256.h -- SHA-256 Hash -2010-06-11 : Igor Pavlov : Public domain */ - -#ifndef __CRYPTO_SHA256_H -#define __CRYPTO_SHA256_H - -#include "Types.h" - -EXTERN_C_BEGIN - -#define SHA256_DIGEST_SIZE 32 - -#define __USE_CLAM_SHA256_FOR_7Z__ - -#ifndef __USE_CLAM_SHA256_FOR_7Z__ -typedef struct -{ - UInt32 state[8]; - UInt64 count; - Byte buffer[64]; -} CSha256; - -void Sha256_Init(CSha256 *p); -void Sha256_Update(CSha256 *p, const Byte *data, size_t size); -void Sha256_Final(CSha256 *p, Byte *digest); -#else -#include "../sha256.h" -#define CSha256 SHA256_CTX -#define Sha256_Init sha256_init -#define Sha256_Update sha256_update -#define Sha256_Final sha256_final -#endif -EXTERN_C_END - -#endif diff --git a/libclamav/7z/Xz.c b/libclamav/7z/Xz.c index 0bdf047c7..cdadfbd4b 100755 --- a/libclamav/7z/Xz.c +++ b/libclamav/7z/Xz.c @@ -1,6 +1,10 @@ /* Xz.c - Xz 2009-04-15 : Igor Pavlov : Public domain */ +#include +#include +#include "libclamav/crypto.h" + #include "7zCrc.h" #include "CpuArch.h" #include "Xz.h" @@ -49,7 +53,7 @@ void XzCheck_Init(CXzCheck *p, int mode) { case XZ_CHECK_CRC32: p->crc = CRC_INIT_VAL; break; case XZ_CHECK_CRC64: p->crc64 = CRC64_INIT_VAL; break; - case XZ_CHECK_SHA256: Sha256_Init(&p->sha); break; + case XZ_CHECK_SHA256: EVP_DigestInit(&p->sha, EVP_sha256()); break; } } @@ -59,7 +63,7 @@ void XzCheck_Update(CXzCheck *p, const void *data, size_t size) { case XZ_CHECK_CRC32: p->crc = CrcUpdate(p->crc, data, size); break; case XZ_CHECK_CRC64: p->crc64 = Crc64Update(p->crc64, data, size); break; - case XZ_CHECK_SHA256: Sha256_Update(&p->sha, (const Byte *)data, size); break; + case XZ_CHECK_SHA256: EVP_DigestUpdate(&p->sha, (const Byte *)data, size); break; } } @@ -79,7 +83,7 @@ int XzCheck_Final(CXzCheck *p, Byte *digest) break; } case XZ_CHECK_SHA256: - Sha256_Final(&p->sha, digest); + EVP_DigestFinal(&p->sha, digest, NULL); break; default: return 0; diff --git a/libclamav/7z/Xz.h b/libclamav/7z/Xz.h index d30796336..5605f3fc5 100755 --- a/libclamav/7z/Xz.h +++ b/libclamav/7z/Xz.h @@ -4,7 +4,9 @@ #ifndef __XZ_H #define __XZ_H -#include "Sha256.h" +#include "Types.h" + +#define SHA256_DIGEST_SIZE 32 EXTERN_C_BEGIN @@ -79,7 +81,7 @@ typedef struct int mode; UInt32 crc; UInt64 crc64; - CSha256 sha; + EVP_MD_CTX sha; } CXzCheck; void XzCheck_Init(CXzCheck *p, int mode); @@ -215,7 +217,7 @@ typedef struct CMixCoder decoder; CXzBlock block; CXzCheck check; - CSha256 sha; + EVP_MD_CTX sha; Byte shaDigest[SHA256_DIGEST_SIZE]; Byte buf[XZ_BLOCK_HEADER_SIZE_MAX]; } CXzUnpacker; diff --git a/libclamav/7z/XzDec.c b/libclamav/7z/XzDec.c index 2eca1afa1..196a066cb 100755 --- a/libclamav/7z/XzDec.c +++ b/libclamav/7z/XzDec.c @@ -10,6 +10,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "7zCrc.h" #include "Alloc.h" #include "Bra.h" @@ -642,7 +646,7 @@ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, Byte temp[32]; unsigned num = Xz_WriteVarInt(temp, p->packSize + p->blockHeaderSize + XzFlags_GetCheckSize(p->streamFlags)); num += Xz_WriteVarInt(temp + num, p->unpackSize); - Sha256_Update(&p->sha, temp, num); + EVP_DigestUpdate(&p->sha, temp, num); p->indexSize += num; p->numBlocks++; @@ -677,7 +681,7 @@ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, { RINOK(Xz_ParseHeader(&p->streamFlags, p->buf)); p->state = XZ_STATE_BLOCK_HEADER; - Sha256_Init(&p->sha); + EVP_DigestInit(&p->sha, EVP_sha256()); p->indexSize = 0; p->numBlocks = 0; p->pos = 0; @@ -696,8 +700,8 @@ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, p->indexPreSize = 1 + Xz_WriteVarInt(p->buf + 1, p->numBlocks); p->indexPos = p->indexPreSize; p->indexSize += p->indexPreSize; - Sha256_Final(&p->sha, p->shaDigest); - Sha256_Init(&p->sha); + EVP_DigestFinal(&p->sha, p->shaDigest, NULL); + EVP_DigestInit(&p->sha, EVP_sha256()); p->crc = CrcUpdate(CRC_INIT_VAL, p->buf, p->indexPreSize); p->state = XZ_STATE_STREAM_INDEX; } @@ -775,7 +779,7 @@ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, if (srcRem > cur) srcRem = (SizeT)cur; p->crc = CrcUpdate(p->crc, src, srcRem); - Sha256_Update(&p->sha, src, srcRem); + EVP_DigestUpdate(&p->sha, src, srcRem); (*srcLen) += srcRem; src += srcRem; p->indexPos += srcRem; @@ -796,7 +800,7 @@ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, p->state = XZ_STATE_STREAM_INDEX_CRC; p->indexSize += 4; p->pos = 0; - Sha256_Final(&p->sha, digest); + EVP_DigestFinal(&p->sha, digest, NULL); if (memcmp(digest, p->shaDigest, SHA256_DIGEST_SIZE) != 0) return SZ_ERROR_CRC; } diff --git a/libclamav/7z/XzIn.c b/libclamav/7z/XzIn.c index 356d01937..5320bd212 100755 --- a/libclamav/7z/XzIn.c +++ b/libclamav/7z/XzIn.c @@ -3,6 +3,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "7zCrc.h" #include "CpuArch.h" #include "Xz.h" diff --git a/libclamav/7z_iface.c b/libclamav/7z_iface.c index b48cc3bc9..0bea5d503 100644 --- a/libclamav/7z_iface.c +++ b/libclamav/7z_iface.c @@ -19,6 +19,10 @@ */ +#include +#include +#include "libclamav/crypto.h" + #include "7z_iface.h" #include "lzma_iface.h" #include "scanners.h" diff --git a/libclamav/Makefile.am b/libclamav/Makefile.am index 9d808240a..58533fa32 100644 --- a/libclamav/Makefile.am +++ b/libclamav/Makefile.am @@ -73,10 +73,13 @@ endif libclamav_internal_utils_la_SOURCES=str.c\ str.h\ + conv.c \ + conv.h \ + crypto.c \ + crypto.h \ + clamav.h \ iowrap.c \ iowrap.h \ - md5.c\ - md5.h\ others_common.c \ others.h \ qsort.c \ @@ -91,15 +94,18 @@ libclamav_internal_utils_la_SOURCES=str.c\ regex/regex2.h \ regex/utils.h -libclamav_internal_utils_la_LDFLAGS=-static +libclamav_internal_utils_la_LDFLAGS=-static @LIBCLAMAV_LIBS@ libclamav_internal_utils_la_CFLAGS=$(AM_CFLAGS) -fPIC -DPIC libclamav_internal_utils_nothreads_la_SOURCES=str.c\ + conv.c \ + conv.h \ + crypto.c \ + crypto.h \ + clamav.h \ str.h\ iowrap.c \ iowrap.h \ - md5.c\ - md5.h\ others_common.c \ others.h \ qsort.c \ @@ -114,7 +120,7 @@ libclamav_internal_utils_nothreads_la_SOURCES=str.c\ regex/regex2.h \ regex/utils.h -libclamav_internal_utils_nothreads_la_LDFLAGS=-static +libclamav_internal_utils_nothreads_la_LDFLAGS=-static @LIBCLAMAV_LIBS@ libclamav_internal_utils_nothreads_la_CFLAGS=$(AM_CFLAGS) -DCL_NOTHREADS if ENABLE_LLVM @@ -143,7 +149,6 @@ endif include_HEADERS = clamav.h libclamav_la_SOURCES = \ - clamav.h \ matcher-ac.c \ matcher-ac.h \ matcher-bm.c \ @@ -325,7 +330,6 @@ libclamav_la_SOURCES = \ 7z/XzCrc64.h \ 7z/XzDec.c \ 7z/XzIn.c \ - 7z/Sha256.h \ 7z/Delta.c \ 7z/Delta.h \ 7z/Alloc.h \ @@ -357,10 +361,6 @@ libclamav_la_SOURCES = \ perflogging.c\ perflogging.h\ default.h\ - sha256.c\ - sha256.h\ - sha1.c\ - sha1.h\ bytecode.c\ bytecode.h\ bytecode_vm.c\ diff --git a/libclamav/Makefile.in b/libclamav/Makefile.in index 97ac770d6..e664299fb 100644 --- a/libclamav/Makefile.in +++ b/libclamav/Makefile.in @@ -148,6 +148,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -237,7 +238,6 @@ am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \ libclamav_la-uniq.lo libclamav_la-version.lo \ libclamav_la-mpool.lo libclamav_la-filtering.lo \ libclamav_la-fmap.lo libclamav_la-perflogging.lo \ - libclamav_la-sha256.lo libclamav_la-sha1.lo \ libclamav_la-bytecode.lo libclamav_la-bytecode_vm.lo \ libclamav_la-cpio.lo libclamav_la-macho.lo \ libclamav_la-ishield.lo libclamav_la-bytecode_api.lo \ @@ -312,8 +312,9 @@ libclamav_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ libclamav_internal_utils_la_LIBADD = am_libclamav_internal_utils_la_OBJECTS = \ libclamav_internal_utils_la-str.lo \ + libclamav_internal_utils_la-conv.lo \ + libclamav_internal_utils_la-crypto.lo \ libclamav_internal_utils_la-iowrap.lo \ - libclamav_internal_utils_la-md5.lo \ libclamav_internal_utils_la-others_common.lo \ libclamav_internal_utils_la-qsort.lo \ libclamav_internal_utils_la-strlcpy.lo \ @@ -330,8 +331,9 @@ libclamav_internal_utils_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ libclamav_internal_utils_nothreads_la_LIBADD = am_libclamav_internal_utils_nothreads_la_OBJECTS = \ libclamav_internal_utils_nothreads_la-str.lo \ + libclamav_internal_utils_nothreads_la-conv.lo \ + libclamav_internal_utils_nothreads_la-crypto.lo \ libclamav_internal_utils_nothreads_la-iowrap.lo \ - libclamav_internal_utils_nothreads_la-md5.lo \ libclamav_internal_utils_nothreads_la-others_common.lo \ libclamav_internal_utils_nothreads_la-qsort.lo \ libclamav_internal_utils_nothreads_la-strlcpy.lo \ @@ -693,10 +695,13 @@ EXTRA_DIST = c++/Makefile.nollvm.in $(am__append_4) regex/engine.c \ @ENABLE_UNRAR_TRUE@IFACEDEP = libclamunrar_iface.la libclamav_internal_utils_la_SOURCES = str.c\ str.h\ + conv.c \ + conv.h \ + crypto.c \ + crypto.h \ + clamav.h \ iowrap.c \ iowrap.h \ - md5.c\ - md5.h\ others_common.c \ others.h \ qsort.c \ @@ -711,14 +716,17 @@ libclamav_internal_utils_la_SOURCES = str.c\ regex/regex2.h \ regex/utils.h -libclamav_internal_utils_la_LDFLAGS = -static +libclamav_internal_utils_la_LDFLAGS = -static @LIBCLAMAV_LIBS@ libclamav_internal_utils_la_CFLAGS = $(AM_CFLAGS) -fPIC -DPIC libclamav_internal_utils_nothreads_la_SOURCES = str.c\ + conv.c \ + conv.h \ + crypto.c \ + crypto.h \ + clamav.h \ str.h\ iowrap.c \ iowrap.h \ - md5.c\ - md5.h\ others_common.c \ others.h \ qsort.c \ @@ -733,7 +741,7 @@ libclamav_internal_utils_nothreads_la_SOURCES = str.c\ regex/regex2.h \ regex/utils.h -libclamav_internal_utils_nothreads_la_LDFLAGS = -static +libclamav_internal_utils_nothreads_la_LDFLAGS = -static @LIBCLAMAV_LIBS@ libclamav_internal_utils_nothreads_la_CFLAGS = $(AM_CFLAGS) -DCL_NOTHREADS @ENABLE_LLVM_FALSE@LLVMLIBADD = libclamav_nocxx.la @ENABLE_LLVM_TRUE@LLVMLIBADD = c++/libclamavcxx.la -lstdc++ -lm @@ -747,7 +755,7 @@ libclamav_la_CFLAGS = $(AM_CFLAGS) $(XML_CPPFLAGS) -DSEARCH_LIBDIR=\"$(libdir)\" libclamav_la_LDFLAGS = @TH_SAFE@ $(XML_LIBS) -version-info \ @LIBCLAMAV_VERSION@ -no-undefined $(am__append_6) include_HEADERS = clamav.h -libclamav_la_SOURCES = clamav.h matcher-ac.c matcher-ac.h matcher-bm.c \ +libclamav_la_SOURCES = matcher-ac.c matcher-ac.h matcher-bm.c \ matcher-bm.h matcher-hash.c matcher-hash.h matcher.c matcher.h \ others.c others.h readdb.c readdb.h cvd.c cvd.h dsig.c dsig.h \ scanners.c scanners.h textdet.c textdet.h filetypes.c \ @@ -780,14 +788,13 @@ libclamav_la_SOURCES = clamav.h matcher-ac.c matcher-ac.h matcher-bm.c \ 7z/Bra.c 7z/Bra.h 7z/Bra86.c 7z/CpuArch.h 7z/Lzma2Dec.c \ 7z/Lzma2Dec.h 7z/LzmaDec.c 7z/LzmaDec.h 7z/Ppmd.h 7z/Ppmd7.c \ 7z/Ppmd7.h 7z/Ppmd7Dec.c 7z/Types.h 7z/Xz.c 7z/Xz.h \ - 7z/XzCrc64.c 7z/XzCrc64.h 7z/XzDec.c 7z/XzIn.c 7z/Sha256.h \ - 7z/Delta.c 7z/Delta.h 7z/Alloc.h 7z/BraIA64.c 7z/CpuArch.c \ - 7z/CpuArch.h 7z/7zCrcOpt.c 7z/RotateDefs.h explode.c explode.h \ - textnorm.c textnorm.h dlp.c dlp.h jsparse/js-norm.c \ - jsparse/js-norm.h jsparse/lexglobal.h jsparse/textbuf.h uniq.c \ - uniq.h version.c version.h mpool.c mpool.h filtering.h \ - filtering.c fmap.c fmap.h perflogging.c perflogging.h \ - default.h sha256.c sha256.h sha1.c sha1.h bytecode.c \ + 7z/XzCrc64.c 7z/XzCrc64.h 7z/XzDec.c 7z/XzIn.c 7z/Delta.c \ + 7z/Delta.h 7z/Alloc.h 7z/BraIA64.c 7z/CpuArch.c 7z/CpuArch.h \ + 7z/7zCrcOpt.c 7z/RotateDefs.h explode.c explode.h textnorm.c \ + textnorm.h dlp.c dlp.h jsparse/js-norm.c jsparse/js-norm.h \ + jsparse/lexglobal.h jsparse/textbuf.h uniq.c uniq.h version.c \ + version.h mpool.c mpool.h filtering.h filtering.c fmap.c \ + fmap.h perflogging.c perflogging.h default.h bytecode.c \ bytecode.h bytecode_vm.c bytecode_priv.h clambc.h cpio.c \ cpio.h macho.c macho.h ishield.c ishield.h type_desc.h \ bcfeatures.h bytecode_api.c bytecode_api_decl.c bytecode_api.h \ @@ -964,8 +971,9 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bytecode_nojit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-conv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-crypto.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-iowrap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-others_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-qsort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-regcomp.Plo@am__quote@ @@ -974,8 +982,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-regfree.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-str.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_la-strlcpy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_nothreads_la-conv.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_nothreads_la-crypto.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_nothreads_la-iowrap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_nothreads_la-md5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_nothreads_la-others_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_nothreads_la-qsort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_internal_utils_nothreads_la-regcomp.Plo@am__quote@ @@ -1169,8 +1178,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-s_fp_sub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-scanners.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-sf_base64decode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-sha1.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-sha256.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-sis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-special.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libclamav_la-spin.Plo@am__quote@ @@ -1920,20 +1927,6 @@ libclamav_la-perflogging.lo: perflogging.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @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-perflogging.lo `test -f 'perflogging.c' || echo '$(srcdir)/'`perflogging.c -libclamav_la-sha256.lo: sha256.c -@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-sha256.lo -MD -MP -MF $(DEPDIR)/libclamav_la-sha256.Tpo -c -o libclamav_la-sha256.lo `test -f 'sha256.c' || echo '$(srcdir)/'`sha256.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_la-sha256.Tpo $(DEPDIR)/libclamav_la-sha256.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sha256.c' object='libclamav_la-sha256.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@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-sha256.lo `test -f 'sha256.c' || echo '$(srcdir)/'`sha256.c - -libclamav_la-sha1.lo: sha1.c -@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-sha1.lo -MD -MP -MF $(DEPDIR)/libclamav_la-sha1.Tpo -c -o libclamav_la-sha1.lo `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_la-sha1.Tpo $(DEPDIR)/libclamav_la-sha1.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sha1.c' object='libclamav_la-sha1.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@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-sha1.lo `test -f 'sha1.c' || echo '$(srcdir)/'`sha1.c - libclamav_la-bytecode.lo: bytecode.c @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-bytecode.lo -MD -MP -MF $(DEPDIR)/libclamav_la-bytecode.Tpo -c -o libclamav_la-bytecode.lo `test -f 'bytecode.c' || echo '$(srcdir)/'`bytecode.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_la-bytecode.Tpo $(DEPDIR)/libclamav_la-bytecode.Plo @@ -2718,6 +2711,20 @@ libclamav_internal_utils_la-str.lo: str.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @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_internal_utils_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_la-str.lo `test -f 'str.c' || echo '$(srcdir)/'`str.c +libclamav_internal_utils_la-conv.lo: conv.c +@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_internal_utils_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_la-conv.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_la-conv.Tpo -c -o libclamav_internal_utils_la-conv.lo `test -f 'conv.c' || echo '$(srcdir)/'`conv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_la-conv.Tpo $(DEPDIR)/libclamav_internal_utils_la-conv.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conv.c' object='libclamav_internal_utils_la-conv.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@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_internal_utils_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_la-conv.lo `test -f 'conv.c' || echo '$(srcdir)/'`conv.c + +libclamav_internal_utils_la-crypto.lo: crypto.c +@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_internal_utils_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_la-crypto.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_la-crypto.Tpo -c -o libclamav_internal_utils_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_la-crypto.Tpo $(DEPDIR)/libclamav_internal_utils_la-crypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='libclamav_internal_utils_la-crypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@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_internal_utils_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c + libclamav_internal_utils_la-iowrap.lo: iowrap.c @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_internal_utils_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_la-iowrap.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_la-iowrap.Tpo -c -o libclamav_internal_utils_la-iowrap.lo `test -f 'iowrap.c' || echo '$(srcdir)/'`iowrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_la-iowrap.Tpo $(DEPDIR)/libclamav_internal_utils_la-iowrap.Plo @@ -2725,13 +2732,6 @@ libclamav_internal_utils_la-iowrap.lo: iowrap.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @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_internal_utils_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_la-iowrap.lo `test -f 'iowrap.c' || echo '$(srcdir)/'`iowrap.c -libclamav_internal_utils_la-md5.lo: md5.c -@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_internal_utils_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_la-md5.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_la-md5.Tpo -c -o libclamav_internal_utils_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_la-md5.Tpo $(DEPDIR)/libclamav_internal_utils_la-md5.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='libclamav_internal_utils_la-md5.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@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_internal_utils_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c - libclamav_internal_utils_la-others_common.lo: others_common.c @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_internal_utils_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_la-others_common.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_la-others_common.Tpo -c -o libclamav_internal_utils_la-others_common.lo `test -f 'others_common.c' || echo '$(srcdir)/'`others_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_la-others_common.Tpo $(DEPDIR)/libclamav_internal_utils_la-others_common.Plo @@ -2788,6 +2788,20 @@ libclamav_internal_utils_nothreads_la-str.lo: str.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_nothreads_la-str.lo `test -f 'str.c' || echo '$(srcdir)/'`str.c +libclamav_internal_utils_nothreads_la-conv.lo: conv.c +@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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_nothreads_la-conv.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_nothreads_la-conv.Tpo -c -o libclamav_internal_utils_nothreads_la-conv.lo `test -f 'conv.c' || echo '$(srcdir)/'`conv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_nothreads_la-conv.Tpo $(DEPDIR)/libclamav_internal_utils_nothreads_la-conv.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='conv.c' object='libclamav_internal_utils_nothreads_la-conv.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_nothreads_la-conv.lo `test -f 'conv.c' || echo '$(srcdir)/'`conv.c + +libclamav_internal_utils_nothreads_la-crypto.lo: crypto.c +@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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_nothreads_la-crypto.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_nothreads_la-crypto.Tpo -c -o libclamav_internal_utils_nothreads_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_nothreads_la-crypto.Tpo $(DEPDIR)/libclamav_internal_utils_nothreads_la-crypto.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='crypto.c' object='libclamav_internal_utils_nothreads_la-crypto.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_nothreads_la-crypto.lo `test -f 'crypto.c' || echo '$(srcdir)/'`crypto.c + libclamav_internal_utils_nothreads_la-iowrap.lo: iowrap.c @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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_nothreads_la-iowrap.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_nothreads_la-iowrap.Tpo -c -o libclamav_internal_utils_nothreads_la-iowrap.lo `test -f 'iowrap.c' || echo '$(srcdir)/'`iowrap.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_nothreads_la-iowrap.Tpo $(DEPDIR)/libclamav_internal_utils_nothreads_la-iowrap.Plo @@ -2795,13 +2809,6 @@ libclamav_internal_utils_nothreads_la-iowrap.lo: iowrap.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_nothreads_la-iowrap.lo `test -f 'iowrap.c' || echo '$(srcdir)/'`iowrap.c -libclamav_internal_utils_nothreads_la-md5.lo: md5.c -@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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_nothreads_la-md5.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_nothreads_la-md5.Tpo -c -o libclamav_internal_utils_nothreads_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_nothreads_la-md5.Tpo $(DEPDIR)/libclamav_internal_utils_nothreads_la-md5.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='md5.c' object='libclamav_internal_utils_nothreads_la-md5.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -c -o libclamav_internal_utils_nothreads_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c - libclamav_internal_utils_nothreads_la-others_common.lo: others_common.c @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_internal_utils_nothreads_la_CFLAGS) $(CFLAGS) -MT libclamav_internal_utils_nothreads_la-others_common.lo -MD -MP -MF $(DEPDIR)/libclamav_internal_utils_nothreads_la-others_common.Tpo -c -o libclamav_internal_utils_nothreads_la-others_common.lo `test -f 'others_common.c' || echo '$(srcdir)/'`others_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libclamav_internal_utils_nothreads_la-others_common.Tpo $(DEPDIR)/libclamav_internal_utils_nothreads_la-others_common.Plo diff --git a/libclamav/adc.c b/libclamav/adc.c index b90b89999..a1756fcbe 100644 --- a/libclamav/adc.c +++ b/libclamav/adc.c @@ -28,6 +28,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "adc.h" diff --git a/libclamav/asn1.c b/libclamav/asn1.c index 655648e92..a69d122b6 100644 --- a/libclamav/asn1.c +++ b/libclamav/asn1.c @@ -24,9 +24,11 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "asn1.h" -#include "sha1.h" -#include "md5.h" #include "bignum.h" #include "matcher-hash.h" @@ -97,37 +99,19 @@ struct cli_asn1 { }; static int map_sha1(fmap_t *map, const void *data, unsigned int len, uint8_t sha1[SHA1_HASH_SIZE]) { - SHA1Context ctx; if(!fmap_need_ptr_once(map, data, len)) { cli_dbgmsg("map_sha1: failed to read hash data\n"); return 1; } - SHA1Init(&ctx); - while(len) { - unsigned int todo = MIN(len, map->pgsz); - SHA1Update(&ctx, data, todo); - data = (uint8_t *)data + todo; - len -= todo; - } - SHA1Final(&ctx, sha1); - return 0; + return (cl_sha1(data, len, sha1, NULL) == NULL); } static int map_md5(fmap_t *map, const void *data, unsigned int len, uint8_t *md5) { - cli_md5_ctx ctx; if(!fmap_need_ptr_once(map, data, len)) { cli_dbgmsg("map_md5: failed to read hash data\n"); return 1; } - cli_md5_init(&ctx); - while(len) { - unsigned int todo = MIN(len, map->pgsz); - cli_md5_update(&ctx, data, len); - data = (uint8_t *)data + todo; - len -= todo; - } - cli_md5_final(md5, &ctx); - return 0; + return (cl_hash_data("md5", data, len, md5, NULL) == NULL); } @@ -746,8 +730,8 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg const uint8_t *message, *attrs; unsigned int dsize, message_size, attrs_size; cli_crt_hashtype hashtype; - SHA1Context ctx; cli_crt *x509; + EVP_MD_CTX *ctx; int result; int isBlacklisted = 0; @@ -1037,10 +1021,15 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg break; } - SHA1Init(&ctx); - SHA1Update(&ctx, "\x31", 1); - SHA1Update(&ctx, attrs + 1, attrs_size - 1); - SHA1Final(&ctx, sha1); + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + break; + + EVP_DigestInit(ctx, EVP_sha1()); + EVP_DigestUpdate(ctx, "\x31", 1); + EVP_DigestUpdate(ctx, attrs + 1, attrs_size - 1); + EVP_DigestFinal(ctx, sha1, NULL); + EVP_MD_CTX_destroy(ctx); if(!fmap_need_ptr_once(map, asn1.content, asn1.size)) { cli_dbgmsg("asn1_parse_mscat: failed to read encryptedDigest\n"); @@ -1278,16 +1267,25 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg } if(hashtype == CLI_SHA1RSA) { - SHA1Init(&ctx); - SHA1Update(&ctx, "\x31", 1); - SHA1Update(&ctx, attrs + 1, attrs_size - 1); - SHA1Final(&ctx, sha1); + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + break; + + EVP_DigestInit(ctx, EVP_sha1()); + EVP_DigestUpdate(ctx, "\x31", 1); + EVP_DigestUpdate(ctx, attrs + 1, attrs_size - 1); + EVP_DigestFinal(ctx, sha1, NULL); + EVP_MD_CTX_destroy(ctx); } else { - cli_md5_ctx ctx; - cli_md5_init(&ctx); - cli_md5_update(&ctx, "\x31", 1); - cli_md5_update(&ctx, attrs + 1, attrs_size - 1); - cli_md5_final(sha1, &ctx); + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + break; + + EVP_DigestInit(ctx, EVP_md5()); + EVP_DigestUpdate(ctx, "\x31", 1); + EVP_DigestUpdate(ctx, attrs + 1, attrs_size - 1); + EVP_DigestFinal(ctx, sha1, NULL); + EVP_MD_CTX_destroy(ctx); } if(!fmap_need_ptr_once(map, asn1.content, asn1.size)) { diff --git a/libclamav/aspack.c b/libclamav/aspack.c index c53e7bb9a..5687de155 100644 --- a/libclamav/aspack.c +++ b/libclamav/aspack.c @@ -19,6 +19,11 @@ */ #include + +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "execs.h" #include "others.h" diff --git a/libclamav/autoit.c b/libclamav/autoit.c index bbaa688f2..2d4f9c380 100644 --- a/libclamav/autoit.c +++ b/libclamav/autoit.c @@ -35,6 +35,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "scanners.h" #include "autoit.h" diff --git a/libclamav/binhex.c b/libclamav/binhex.c index fd9368bca..61f655e78 100644 --- a/libclamav/binhex.c +++ b/libclamav/binhex.c @@ -25,6 +25,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "scanners.h" #include "cltypes.h" #include "others.h" diff --git a/libclamav/blob.c b/libclamav/blob.c index c3fe47a3e..707e44fc7 100644 --- a/libclamav/blob.c +++ b/libclamav/blob.c @@ -44,6 +44,10 @@ static char const rcsid[] = "$Id: blob.c,v 1.64 2007/02/12 22:25:14 njh Exp $"; #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "mbox.h" #include "matcher.h" diff --git a/libclamav/bytecode.c b/libclamav/bytecode.c index 63bf49d72..55106487e 100644 --- a/libclamav/bytecode.c +++ b/libclamav/bytecode.c @@ -24,8 +24,14 @@ #include "clamav-config.h" #endif +#include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "dconf.h" #include "clamav.h" #include "others.h" @@ -38,7 +44,6 @@ #include "bytecode_api.h" #include "bytecode_api_impl.h" #include "builtin_bytecodes.h" -#include #define MAX_BC 64 #define BC_EVENTS_PER_SIG 2 diff --git a/libclamav/bytecode_api.c b/libclamav/bytecode_api.c index f0f9f746f..65d68b62b 100644 --- a/libclamav/bytecode_api.c +++ b/libclamav/bytecode_api.c @@ -33,6 +33,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "clambc.h" #include "bytecode.h" diff --git a/libclamav/bytecode_detect.c b/libclamav/bytecode_detect.c index fc5d6e9b0..2e36ef8d5 100644 --- a/libclamav/bytecode_detect.c +++ b/libclamav/bytecode_detect.c @@ -23,6 +23,11 @@ #if HAVE_CONFIG_H #include "clamav-config.h" #endif + +#include +#include +#include "libclamav/crypto.h" + #include "target.h" #include "cltypes.h" diff --git a/libclamav/bytecode_nojit.c b/libclamav/bytecode_nojit.c index 66d385d6a..48cccc3e5 100644 --- a/libclamav/bytecode_nojit.c +++ b/libclamav/bytecode_nojit.c @@ -22,6 +22,11 @@ #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "bytecode.h" #include "bytecode_priv.h" diff --git a/libclamav/bytecode_vm.c b/libclamav/bytecode_vm.c index ba3f44f21..4a7342c34 100644 --- a/libclamav/bytecode_vm.c +++ b/libclamav/bytecode_vm.c @@ -22,6 +22,11 @@ #if HAVE_CONFIG_H #include "clamav-config.h" #endif + +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "bytecode.h" diff --git a/libclamav/c++/bytecode2llvm.cpp b/libclamav/c++/bytecode2llvm.cpp index 1ec53ed8c..c5b50d1f2 100644 --- a/libclamav/c++/bytecode2llvm.cpp +++ b/libclamav/c++/bytecode2llvm.cpp @@ -24,6 +24,7 @@ #ifndef _WIN32 #include #endif + #include "ClamBCModule.h" #include "ClamBCDiagnostics.h" #include "llvm/Analysis/DebugInfo.h" @@ -126,15 +127,20 @@ void LLVMInitializePowerPCAsmPrinter(); #undef PACKAGE_URL #include "clamav-config.h" #endif + +#include +#include + +extern "C" { +#include "libclamav/crypto.h" +} + #include "dconf.h" #include "clamav.h" #include "clambc.h" #include "bytecode.h" #include "bytecode_priv.h" #include "type_desc.h" -extern "C" { -#include "md5.h" -} #define MODULE "libclamav JIT: " @@ -2201,15 +2207,12 @@ int cli_vm_execute_jit(const struct cli_all_bc *bcs, struct cli_bc_ctx *ctx, static unsigned char name_salt[16] = { 16, 38, 97, 12, 8, 4, 72, 196, 217, 144, 33, 124, 18, 11, 17, 253 }; static void setGuard(unsigned char* guardbuf) { - cli_md5_ctx ctx; char salt[48]; memcpy(salt, name_salt, 16); for(unsigned i = 16; i < 48; i++) - salt[i] = cli_rndnum(255); + salt[i] = cli_rndnum(255); - cli_md5_init(&ctx); - cli_md5_update(&ctx, salt, 48); - cli_md5_final(guardbuf, &ctx); + cl_hash_data("md5", salt, 48, guardbuf, NULL); } static void addFPasses(FunctionPassManager &FPM, bool trusted, const TargetData *TD) diff --git a/libclamav/cab.c b/libclamav/cab.c index f82d0289a..e15bfe625 100644 --- a/libclamav/cab.c +++ b/libclamav/cab.c @@ -32,6 +32,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "mspack.h" diff --git a/libclamav/cache.c b/libclamav/cache.c index 1ad2b2655..547fdb02e 100644 --- a/libclamav/cache.c +++ b/libclamav/cache.c @@ -27,7 +27,10 @@ #include #include -#include "md5.h" +#include +#include +#include "libclamav/crypto.h" + #include "mpool.h" #include "clamav.h" #include "cache.h" @@ -902,7 +905,7 @@ void cache_remove(unsigned char *md5, size_t size, const struct cl_engine *engin int cache_check(unsigned char *hash, cli_ctx *ctx) { fmap_t *map; size_t todo, at = 0; - cli_md5_ctx md5; + EVP_MD_CTX *hashctx; int ret; if(!ctx || !ctx->engine || !ctx->engine->cache) @@ -916,20 +919,30 @@ int cache_check(unsigned char *hash, cli_ctx *ctx) { map = *ctx->fmap; todo = map->len; - cli_md5_init(&md5); + hashctx = EVP_MD_CTX_create(); + if (!(hashctx)) + return CL_VIRUS; + EVP_DigestInit(hashctx, EVP_md5()); + while(todo) { - const void *buf; - size_t readme = todo < FILEBUFF ? todo : FILEBUFF; - if(!(buf = fmap_need_off_once(map, at, readme))) - return CL_EREAD; - todo -= readme; - at += readme; - if (cli_md5_update(&md5, buf, readme)) { - cli_errmsg("cache_check: error reading while generating hash!\n"); - return CL_EREAD; - } + const void *buf; + size_t readme = todo < FILEBUFF ? todo : FILEBUFF; + + if(!(buf = fmap_need_off_once(map, at, readme))) + return CL_EREAD; + + todo -= readme; + at += readme; + + if (!EVP_DigestUpdate(hashctx, buf, readme)) { + cli_errmsg("cache_check: error reading while generating hash!\n"); + return CL_EREAD; + } } - cli_md5_final(hash, &md5); + + EVP_DigestFinal(hashctx, hash, NULL); + EVP_MD_CTX_destroy(hashctx); + ret = cache_lookup_hash(hash, map->len, ctx->engine->cache, ctx->recursion); cli_dbgmsg("cache_check: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x is %s\n", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], (ret == CL_VIRUS) ? "negative" : "positive"); return ret; diff --git a/libclamav/chmunpack.c b/libclamav/chmunpack.c index cda6e0ff1..930299e6a 100644 --- a/libclamav/chmunpack.c +++ b/libclamav/chmunpack.c @@ -34,6 +34,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "fmap.h" #include "others.h" #include "mspack.h" diff --git a/libclamav/conv.c b/libclamav/conv.c new file mode 100644 index 000000000..7156f14d7 --- /dev/null +++ b/libclamav/conv.c @@ -0,0 +1,189 @@ +/* + * Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved. + * + * Author: Shawn Webb + * + * 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. + */ + +#if HAVE_CONF_H +#include "clamav-config.h" +#endif + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#include + +#include + +#include +#include + +#include "libclamav/conv.h" +#include "libclamav/crypto.h" + +/** Get the expected decoded length of a base64-encoded string + * @param[in] data Base64-encoded string + * @param[in] len length of the string + * @return The expected decoded length of the base64-encoded string + */ +static size_t base64_len(const char *data, size_t len) +{ + int padding=0; + size_t i; + + if (!len) + return 0; + + for (i=len-1; i > 0 && data[i] == '='; i--) + padding++; + + return (size_t)((3*len)/4 - padding); +} + +/** Decode a base64-encoded string + * @param[in] data The base64-encoded string + * @param[in] len Length of the base64-encoded string + * @param[out] obuf If obuf is not set to NULL, store the decoded data in obuf. Otherwise, the decoded data is stored in a dynamically-allocated buffer. + * @param[out] olen The length of the decoded data + * @return The base64-decoded data + */ +void *cl_base64_decode(char *data, size_t len, void *obuf, size_t *olen) +{ + BIO *bio, *b64; + void *buf, *ret; + + buf = (obuf) ? obuf : malloc(base64_len(data, len)+1); + if (!(buf)) + return NULL; + + b64 = BIO_new(BIO_f_base64()); + if (!(b64)) { + if (!(obuf)) + free(buf); + + return NULL; + } + + bio = BIO_new_mem_buf(data, len); + if (!(bio)) { + BIO_free(b64); + if (!(obuf)) + free(buf); + + return NULL; + } + + bio = BIO_push(b64, bio); + BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL); + + *olen = BIO_read(bio, buf, base64_len(data, len)); + + BIO_free_all(bio); + + return buf; +} + +/** Base64-encode data + * @param[in] data The data to be encoded + * @param[in] len The length of the data + * @return A pointer to the base64-encoded data. The data is stored in a dynamically-allocated buffer. + */ +char *cl_base64_encode(void *data, size_t len) +{ + BIO *bio, *b64; + char *buf, *p; + size_t elen; + + b64 = BIO_new(BIO_f_base64()); + bio = BIO_new(BIO_s_mem()); + + bio = BIO_push(b64, bio); + BIO_write(bio, data, len); + + BIO_flush(bio); + elen = (size_t)BIO_get_mem_data(bio, &buf); + + /* Ensure we're dealing with a NULL-terminated string */ + p = (char *)malloc(elen+1); + memcpy((void *)p, (void *)buf, elen); + p[elen] = 0x00; + buf = p; + + BIO_free_all(bio); + + return buf; +} + +#if defined(CONV_SELF_TEST) + +int main(int argc, char *argv[]) +{ + char *plaintext, *encoded, *decoded; + unsigned char *sha_plaintext, *sha_decoded; + size_t len; + int ret=0; + unsigned int shalen; + + initialize_crypto(); + + plaintext = (argv[1]) ? argv[1] : "Hello. This is dog"; + sha_plaintext = sha256(plaintext, strlen(plaintext), NULL, NULL); + if (!(sha_plaintext)) { + fprintf(stderr, "Could not generate sha256 of plaintext\n"); + return 1; + } + + encoded = base64_encode(plaintext, strlen(plaintext)); + if (!(encoded)) { + fprintf(stderr, "Could not base64 encode plaintest\n"); + return 1; + } + fprintf(stderr, "Base64 encoded: %s\n", encoded); + + decoded = base64_decode(encoded, strlen(encoded), NULL, &len); + if (!(decoded)) { + fprintf(stderr, "Could not base64 decoded string\n"); + return 1; + } + + sha_decoded = sha256(decoded, len, NULL, &shalen); + if (!(sha_decoded)) { + fprintf(stderr, "Could not generate sha256 of decoded data\n"); + return 1; + } + + if (memcmp(sha_plaintext, sha_decoded, shalen)) { + fprintf(stderr, "Decoded does not match plaintext: %s\n", decoded); + ret = 1; + } + + free(sha_decoded); + free(sha_plaintext); + free(encoded); + free(decoded); + + cleanup_crypto(); + + return ret; +} + +#endif diff --git a/libclamav/conv.h b/libclamav/conv.h new file mode 100644 index 000000000..7b83682c5 --- /dev/null +++ b/libclamav/conv.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved. + * + * Author: Shawn Webb + * + * 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. + */ + +#if !defined(_CLAMAV_CONV_H) +#define _CLAMAV_CONV_H + +void *cl_base64_decode(char *, size_t, void *, size_t *); +char *cl_base64_encode(void *, size_t); + +#endif diff --git a/libclamav/cpio.c b/libclamav/cpio.c index 821123bf8..339824fc9 100644 --- a/libclamav/cpio.c +++ b/libclamav/cpio.c @@ -32,6 +32,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "cpio.h" diff --git a/libclamav/crtmgr.c b/libclamav/crtmgr.c index b2616714e..b5435191b 100644 --- a/libclamav/crtmgr.c +++ b/libclamav/crtmgr.c @@ -22,6 +22,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "crtmgr.h" diff --git a/libclamav/crtmgr.h b/libclamav/crtmgr.h index 01c75703d..6d7de04b6 100644 --- a/libclamav/crtmgr.h +++ b/libclamav/crtmgr.h @@ -24,7 +24,6 @@ #include #include "bignum.h" -#include "sha1.h" typedef enum { CLI_SHA1RSA, CLI_MD5RSA } cli_crt_hashtype; typedef enum {VRFY_CODE, VRFY_TIME} cli_vrfy_type; diff --git a/libclamav/crypto.c b/libclamav/crypto.c new file mode 100644 index 000000000..1a2d94c76 --- /dev/null +++ b/libclamav/crypto.c @@ -0,0 +1,1021 @@ +/* + * Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved. + * + * Author: Shawn Webb + * + * 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. + */ + +#if HAVE_CONFIG_H +#include "clamav-config.h" +#endif + +#include +#include +#include + +#include + +#ifdef _WIN32 +#include +#endif + +#include +#include +#include +#include + +#if !defined(_WIN32) +#include +#endif + +#include +#include +#include "libclamav/crypto.h" + +#include "clamav.h" +#include "default.h" +#include "others.h" +#include "libclamav/conv.h" +#include "libclamav/str.h" + +#if defined(_WIN32) +char * strptime(const char *buf, const char *fmt, struct tm *tm); +#endif + +#if !defined(MIN) + #define MIN(x,y) ((x)<(y)?(x):(y)) +#endif + +int cl_initialize_crypto(void) +{ + SSL_load_error_strings(); + SSL_library_init(); + OpenSSL_add_all_digests(); + OpenSSL_add_all_algorithms(); + OpenSSL_add_all_ciphers(); + ERR_load_crypto_strings(); + + return 0; +} + +void cl_cleanup_crypto(void) +{ + EVP_cleanup(); +} + +unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned char *obuf, unsigned int *olen) +{ + EVP_MD_CTX *ctx; + unsigned char *ret; + size_t mdsz; + const EVP_MD *md; + unsigned int i; + size_t cur; + + md = EVP_get_digestbyname(alg); + if (!(md)) + return NULL; + + mdsz = EVP_MD_size(md); + + ret = (obuf != NULL) ? obuf : (unsigned char *)malloc(mdsz); + if (!(ret)) + return NULL; + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) { + if (!(obuf)) + free(ret); + + return NULL; + } + + if (!EVP_DigestInit(ctx, md)) { + if (!(obuf)) + free(ret); + + if ((olen)) + *olen = 0; + + EVP_MD_CTX_destroy(ctx); + return NULL; + } + + cur=0; + while (cur < len) { + size_t todo = MIN(EVP_MD_block_size(md), len-cur); + if (!EVP_DigestUpdate(ctx, (void *)(((unsigned char *)buf)+cur), todo)) { + if (!(obuf)) + free(ret); + + if ((olen)) + *olen = 0; + + EVP_MD_CTX_destroy(ctx); + return NULL; + } + + cur += todo; + } + + if (!EVP_DigestFinal(ctx, ret, &i)) { + if (!(obuf)) + free(ret); + + if ((olen)) + *olen = 0; + + EVP_MD_CTX_destroy(ctx); + return NULL; + } + + EVP_MD_CTX_destroy(ctx); + + if ((olen)) + *olen = i; + + return ret; +} + +unsigned char *cl_hash_file_fd(int fd, char *alg, unsigned int *olen) +{ + EVP_MD_CTX *ctx; + const EVP_MD *md; + unsigned char *res; + + md = EVP_get_digestbyname(alg); + if (!(md)) + return NULL; + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + return NULL; + + if (!EVP_DigestInit(ctx, md)) { + EVP_MD_CTX_destroy(ctx); + return NULL; + } + + res = cl_hash_file_fd_ctx(ctx, fd, olen); + + EVP_MD_CTX_destroy(ctx); + return res; +} + +unsigned char *cl_hash_file_fd_ctx(EVP_MD_CTX *ctx, int fd, unsigned int *olen) +{ + unsigned char *buf; + unsigned char *hash; + int mdsz; + unsigned int hashlen; + struct stat sb; + + unsigned int blocksize; + +#ifdef _WIN32 + int nread; +#else + ssize_t nread; +#endif + + mdsz = EVP_MD_CTX_size(ctx); + + if (fstat(fd, &sb) < 0) { + return NULL; + } + +#ifdef _WIN32 + blocksize = 8192; +#else + blocksize = sb.st_blksize; +#endif + + buf = (unsigned char *)malloc(blocksize); + if (!(buf)) { + return NULL; + } + + hash = (unsigned char *)malloc(mdsz); + if (!(hash)) { + free(buf); + return NULL; + } + +#ifdef _WIN32 + while ((nread = _read(fd, buf, blocksize)) > 0) { +#else + while ((nread = read(fd, buf, blocksize)) > 0) { +#endif + if (!EVP_DigestUpdate(ctx, buf, nread)) { + free(buf); + free(hash); + + return NULL; + } + } + + if (!EVP_DigestFinal(ctx, hash, &hashlen)) { + free(hash); + free(buf); + + return NULL; + } + + if ((olen)) + *olen = hashlen; + + free(buf); + + return hash; +} + +unsigned char *cl_hash_file_fp(FILE *fp, char *alg, unsigned int *olen) +{ + return cl_hash_file_fd(fileno(fp), alg, olen); +} + +unsigned char *cl_sha256(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen) +{ + return cl_hash_data("sha256", buf, len, obuf, olen); +} + +unsigned char *cl_sha1(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen) +{ + return cl_hash_data("sha1", buf, len, obuf, olen); +} + +int cl_verify_signature_hash(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest) +{ + EVP_MD_CTX *ctx; + const EVP_MD *md; + size_t mdsz; + + md = EVP_get_digestbyname(alg); + if (!(md)) + return -1; + + mdsz = EVP_MD_size(md); + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) { + return -1; + } + + if (!EVP_VerifyInit(ctx, md)) { + EVP_MD_CTX_destroy(ctx); + return -1; + } + + if (!EVP_VerifyUpdate(ctx, digest, mdsz)) { + EVP_MD_CTX_destroy(ctx); + return -1; + } + + if (EVP_VerifyFinal(ctx, sig, siglen, pkey) != 0) { + EVP_MD_CTX_destroy(ctx); + return -1; + } + + EVP_MD_CTX_destroy(ctx); + return 0; +} + +int cl_verify_signature_fd(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, int fd) +{ + EVP_MD_CTX *ctx; + const EVP_MD *md; + size_t mdsz; + unsigned char *digest; + + digest = cl_hash_file_fd(fd, alg, NULL); + if (!(digest)) + return -1; + + md = EVP_get_digestbyname(alg); + if (!(md)) + return -1; + + mdsz = EVP_MD_size(md); + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) { + free(digest); + return -1; + } + + if (!EVP_VerifyInit(ctx, md)) { + free(digest); + EVP_MD_CTX_destroy(ctx); + return -1; + } + + if (!EVP_VerifyUpdate(ctx, digest, mdsz)) { + free(digest); + EVP_MD_CTX_destroy(ctx); + return -1; + } + + if (EVP_VerifyFinal(ctx, sig, siglen, pkey) != 0) { + free(digest); + EVP_MD_CTX_destroy(ctx); + return -1; + } + + EVP_MD_CTX_destroy(ctx); + free(digest); + return 0; +} + +int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode) +{ + EVP_MD_CTX *ctx; + const EVP_MD *md; + size_t mdsz; + unsigned char *digest; + + if (decode) { + unsigned char *newsig; + size_t newsiglen; + + newsig = (unsigned char *)cl_base64_decode((char *)sig, siglen, NULL, &newsiglen); + if (!(newsig)) + return -1; + + sig = newsig; + siglen = newsiglen; + } + + digest = cl_hash_data(alg, data, datalen, NULL, NULL); + if (!(digest)) { + if (decode) + free(sig); + + return -1; + } + + md = EVP_get_digestbyname(alg); + if (!(md)) { + free(digest); + if (decode) + free(sig); + + return -1; + } + + mdsz = EVP_MD_size(md); + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) { + free(digest); + if (decode) + free(sig); + + return -1; + } + + if (!EVP_VerifyInit(ctx, md)) { + EVP_MD_CTX_destroy(ctx); + + free(digest); + if (decode) + free(sig); + + return -1; + } + + if (!EVP_VerifyUpdate(ctx, digest, mdsz)) { + EVP_MD_CTX_destroy(ctx); + + free(digest); + if (decode) + free(sig); + + return -1; + } + + if (EVP_VerifyFinal(ctx, sig, siglen, pkey) != 0) { + EVP_MD_CTX_destroy(ctx); + + free(digest); + if (decode) + free(sig); + + return -1; + } + + EVP_MD_CTX_destroy(ctx); + + if (decode) + free(sig); + + free(digest); + return 0; +} + +int cl_verify_signature_hash_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest) +{ + X509 *x509; + FILE *fp; + int res; + + fp = fopen(x509path, "r"); + if (!(fp)) { + return -1; + } + + x509 = PEM_read_X509(fp, NULL, NULL, NULL); + if (!(x509)) { + fclose(fp); + return -1; + } + + fclose(fp); + + res = cl_verify_signature_hash_x509(x509, alg, sig, siglen, digest); + + X509_free(x509); + + return res; +} + +int cl_verify_signature_fd_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, int fd) +{ + X509 *x509; + FILE *fp; + int res; + + fp = fopen(x509path, "r"); + if (!(fp)) { + return -1; + } + + x509 = PEM_read_X509(fp, NULL, NULL, NULL); + if (!(x509)) { + fclose(fp); + return -1; + } + + fclose(fp); + + res = cl_verify_signature_fd_x509(x509, alg, sig, siglen, fd); + + X509_free(x509); + + return res; +} + +int cl_verify_signature_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode) +{ + X509 *x509; + FILE *fp; + int res; + + fp = fopen(x509path, "r"); + if (!(fp)) { + return -1; + } + + x509 = PEM_read_X509(fp, NULL, NULL, NULL); + if (!(x509)) { + fclose(fp); + return -1; + } + + fclose(fp); + + res = cl_verify_signature_x509(x509, alg, sig, siglen, data, datalen, decode); + + X509_free(x509); + + return res; +} + +int cl_verify_signature_hash_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest) +{ + EVP_PKEY *pkey; + int res; + + pkey = X509_get_pubkey(x509); + if (!(pkey)) + return -1; + + res = cl_verify_signature_hash(pkey, alg, sig, siglen, digest); + + EVP_PKEY_free(pkey); + + return res; +} + +int cl_verify_signature_fd_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, int fd) +{ + EVP_PKEY *pkey; + int res; + + pkey = X509_get_pubkey(x509); + if (!(pkey)) + return -1; + + res = cl_verify_signature_fd(pkey, alg, sig, siglen, fd); + + EVP_PKEY_free(pkey); + + return res; +} + +int cl_verify_signature_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode) +{ + EVP_PKEY *pkey; + int res; + + pkey = X509_get_pubkey(x509); + if (!(pkey)) + return -1; + + res = cl_verify_signature(pkey, alg, sig, siglen, data, datalen, decode); + + EVP_PKEY_free(pkey); + + return res; +} + +unsigned char *cl_sign_data_keyfile(char *keypath, char *alg, unsigned char *hash, unsigned int *olen, int encode) +{ + FILE *fp; + EVP_PKEY *pkey; + unsigned char *res; + + fp = fopen(keypath, "r"); + if (!(fp)) { + return NULL; + } + + pkey = PEM_read_PrivateKey(fp, NULL, NULL, NULL); + if (!(pkey)) { + fclose(fp); + return NULL; + } + + fclose(fp); + + res = cl_sign_data(pkey, alg, hash, olen, encode); + + EVP_PKEY_free(pkey); + + return res; +} + +unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsigned int *olen, int encode) +{ + EVP_MD_CTX *ctx; + const EVP_MD *md; + unsigned int siglen; + unsigned char *sig; + + md = EVP_get_digestbyname(alg); + if (!(md)) + return NULL; + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) { + free(hash); + return NULL; + } + + sig = (unsigned char *)calloc(1, EVP_PKEY_size(pkey)); + if (!(sig)) { + EVP_MD_CTX_destroy(ctx); + free(hash); + return NULL; + } + + if (!EVP_SignInit(ctx, md)) { + EVP_MD_CTX_destroy(ctx); + free(sig); + free(hash); + return NULL; + } + + if (!EVP_SignUpdate(ctx, hash, EVP_MD_size(md))) { + EVP_MD_CTX_destroy(ctx); + free(sig); + free(hash); + return NULL; + } + + if (!EVP_SignFinal(ctx, sig, &siglen, pkey)) { + EVP_MD_CTX_destroy(ctx); + free(sig); + free(hash); + return NULL; + } + + if (encode) { + unsigned char *newsig = (unsigned char *)cl_base64_encode(sig, siglen); + if (!(newsig)) { + EVP_MD_CTX_destroy(ctx); + free(sig); + free(hash); + return NULL; + } + + free(sig); + sig = newsig; + siglen = (unsigned int)strlen((const char *)newsig); + } + + EVP_MD_CTX_destroy(ctx); + free(hash); + + *olen = siglen; + return sig; +} + +unsigned char *cl_sign_file_fd(int fd, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode) +{ + unsigned char *hash, *res; + unsigned int hashlen; + + hash = cl_hash_file_fd(fd, alg, &hashlen); + if (!(hash)) { + return NULL; + } + + res = cl_sign_data(pkey, alg, hash, olen, encode); + + free(hash); + return res; +} + +unsigned char *cl_sign_file_fp(FILE *fp, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode) +{ + return cl_sign_file_fd(fileno(fp), pkey, alg, olen, encode); +} + +EVP_PKEY *cl_get_pkey_file(char *keypath) +{ + EVP_PKEY *pkey; + FILE *fp; + + fp = fopen(keypath, "r"); + if (!(fp)) + return NULL; + + if (!(pkey = PEM_read_PrivateKey(fp, NULL, NULL, NULL))) { + fclose(fp); + return NULL; + } + + fclose(fp); + + return pkey; +} + +X509 *cl_get_x509_from_mem(void *data, unsigned int len) +{ + X509 *cert; + BIO *cbio; + + cbio = BIO_new_mem_buf(data, len); + if (!(cbio)) + return NULL; + + cert = PEM_read_bio_X509(cbio, NULL, 0, NULL); + BIO_free(cbio); + + return cert; +} + +int cl_validate_certificate_chain_ts_dir(char *tsdir, char *certpath) +{ + char **authorities=NULL, **t, *fullpath; + size_t nauths = 0; + int res; + DIR *dp; + struct dirent *dirent; +#if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2) + union { + struct dirent d; + char b[offsetof(struct dirent, d_name) + NAME_MAX + 1]; + } result; +#endif + + dp = opendir(tsdir); + if (!(dp)) + return CL_EOPEN; + +#if defined(HAVE_READDIR_R_3) + while (!readdir_r(dp, &result.d, &dirent) && dirent) { +#elif defined(HAVE_READDIR_R_2) + while ((dirent = (struct dirent *)readdir_r(dp, &result.d))) { +#else + while ((dirent = readdir(dp))) { +#endif + if (dirent->d_name[0] == '.') + continue; + + if (!cli_strbcasestr(dirent->d_name, ".crt")) + continue; + + t = (char **)realloc(authorities, sizeof(char **) * (nauths + 1)); + if (!(t)) { + if (nauths) { + while (nauths > 0) + free(authorities[--nauths]); + free(authorities); + return -1; + } + } + + authorities = t; + authorities[nauths] = (char *)malloc(strlen(tsdir) + strlen(dirent->d_name) + 2); + if (!authorities[nauths]) { + if (nauths) { + while (nauths > 0) + free(authorities[nauths--]); + free(authorities[0]); + free(authorities); + return -1; + } + } + + sprintf(authorities[nauths], "%s"PATHSEP"%s", tsdir, dirent->d_name); + nauths++; + } + + t = (char **)realloc(authorities, sizeof(char **) * (nauths + 1)); + if (!(t)) { + if (nauths) { + while (nauths > 0) + free(authorities[--nauths]); + free(authorities); + return -1; + } + } + + authorities = t; + authorities[nauths] = NULL; + + closedir(dp); + + res = cl_validate_certificate_chain(authorities, NULL, certpath); + + while (nauths > 0) + free(authorities[--nauths]); + + free(authorities); + + return res; +} + +int cl_validate_certificate_chain(char **authorities, char *crlpath, char *certpath) +{ + X509_STORE *store=NULL; + X509_STORE_CTX *store_ctx; + X509_LOOKUP *lookup=NULL; + X509_CRL *crl=NULL; + X509_VERIFY_PARAM *param=NULL; + X509 *cert; + unsigned long i; + int res; + + store = X509_STORE_new(); + if (!(store)) { + return -1; + } + X509_STORE_set_flags(store, 0); + + lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file()); + if (!(lookup)) { + X509_STORE_free(store); + return -1; + } + + if ((crlpath)) { + + crl = cl_load_crl(crlpath); + if (!(crl)) { + X509_STORE_free(store); + return -1; + } + + X509_STORE_add_crl(store, crl); + param = X509_VERIFY_PARAM_new(); + if ((param)) { + X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK); + X509_STORE_set1_param(store, param); + } else { + X509_STORE_free(store); + X509_CRL_free(crl); + return -1; + } + } + + /* Support multi-tiered setups */ + for (i=0; authorities[i]; i++) { + if (!X509_LOOKUP_load_file(lookup, authorities[i], X509_FILETYPE_PEM)) { + X509_STORE_free(store); + if ((crl)) + X509_CRL_free(crl); + if ((param)) + X509_VERIFY_PARAM_free(param); + return -1; + } + } + + lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir()); + if (!(lookup)) { + X509_STORE_free(store); + if ((crl)) + X509_CRL_free(crl); + if ((param)) + X509_VERIFY_PARAM_free(param); + return -1; + } + + X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT); + + store_ctx = X509_STORE_CTX_new(); + if (!(store_ctx)) { + X509_STORE_free(store); + if ((crl)) + X509_CRL_free(crl); + if ((param)) + X509_VERIFY_PARAM_free(param); + return -1; + } + + cert = cl_load_cert(certpath); + if (!(cert)) { + X509_STORE_CTX_free(store_ctx); + X509_STORE_free(store); + if ((crl)) + X509_CRL_free(crl); + if ((param)) + X509_VERIFY_PARAM_free(param); + + return -1; + } + + if (!X509_STORE_CTX_init(store_ctx, store, cert, NULL)) { + X509_STORE_CTX_free(store_ctx); + X509_STORE_free(store); + if ((crl)) + X509_CRL_free(crl); + if ((param)) + X509_VERIFY_PARAM_free(param); + + X509_free(cert); + + return -1; + } + + res = X509_verify_cert(store_ctx); + + X509_STORE_CTX_free(store_ctx); + if ((crl)) + X509_CRL_free(crl); + + if ((param)) + X509_VERIFY_PARAM_free(param); + + X509_STORE_free(store); + + X509_free(cert); + + return (res > 0); +} + +X509 *cl_load_cert(const char *certpath) +{ + X509 *cert; + BIO *bio; + + bio = BIO_new(BIO_s_file()); + if (!(bio)) + return NULL; + + if (BIO_read_filename(bio, certpath) != 1) { + BIO_free(bio); + return NULL; + } + + cert = PEM_read_bio_X509_AUX(bio, NULL, NULL, NULL); + + BIO_free(bio); + + return cert; +} + +struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj) +{ + struct tm *t; + char* str; + size_t i = 0; + const char *fmt; + time_t localt; +#ifdef _WIN32 + struct tm localtm, *ltm; +#else + struct tm localtm; +#endif + + if (!(timeobj) || !(timeobj->data)) + return NULL; + + str = (char *)(timeobj->data); + if (strlen(str) < 12) + return NULL; + + t = (struct tm *)calloc(1, sizeof(struct tm)); + if (!(t)) + return NULL; + + if (timeobj->type == V_ASN1_UTCTIME) { + /* two digit year */ + fmt = "%y%m%d%H%M%S"; + if (str[3] == '0') { + str[2] = '0'; + str[3] = '9'; + } else { + str[3]--; + } + } + else if (timeobj->type == V_ASN1_GENERALIZEDTIME) { + /* four digit year */ + fmt = "%Y%m%d%H%M%S"; + if (str[5] == '0') { + str[4] = '0'; + str[5] = '9'; + } else { + str[5]--; + } + } + + if (!strptime(str, fmt, t)) { + free(t); + return NULL; + } + + /* Convert to local time */ + localt = time(NULL); +#ifdef _WIN32 + ltm = localtime(&localt); + memcpy((void *)(&localtm), (void *)ltm, sizeof(struct tm)); +#else + localtime_r(&localt, &localtm); +#endif + t->tm_isdst = localtm.tm_isdst; + return t; +} + +X509_CRL *cl_load_crl(const char *file) +{ + X509_CRL *x=NULL; + FILE *fp; + struct tm *tm; + time_t crltime; + + if (!(file)) + return NULL; + + fp = fopen(file, "r"); + if (!(fp)) + return NULL; + + x = PEM_read_X509_CRL(fp, NULL, NULL, NULL); + + fclose(fp); + + if ((x)) { + tm = cl_ASN1_GetTimeT(x->crl->nextUpdate); + if (!(tm)) { + X509_CRL_free(x); + return NULL; + } + +#if !defined(_WIN32) + if (timegm(tm) < time(NULL)) { + X509_CRL_free(x); + free(tm); + return NULL; + } +#endif + + free(tm); + } + + return x; +} diff --git a/libclamav/crypto.h b/libclamav/crypto.h new file mode 100644 index 000000000..944cfc798 --- /dev/null +++ b/libclamav/crypto.h @@ -0,0 +1,277 @@ +/* + * Copyright (C) 2014 Cisco and/or its affiliates. All rights reserved. + * + * Author: Shawn Webb + * + * 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. + */ + +#if !defined(_CLAMAV_CRYPTO_H) +#define _CLAMAV_CRYPTO_H + +/** + * \defgroup CryptoAPI ClamAV Crypto API + * @{ + */ + +#define SHA1_HASH_SIZE 20 +#define SHA256_HASH_SIZE 32 + +/** + * Initialize the crypto system. + * @return Always returns 0 + */ +int cl_initialize_crypto(void); + +/** Clean up the crypto system prior to program exit. + */ +void cl_cleanup_crypto(void); + +/** Generate a hash of data. + @param[in] alg The hashing algorithm to use + @param[in] buf The data to be hashed + @param[in] len The length of the to-be-hashed data + @param[out] obuf An optional buffer to store the generated hash. Use NULL to dynamically allocate buffer. + @param[out] olen An optional pointer that stores how long the generated hash is. + @return A pointer to the generated hash or obuf if obuf is not NULL. + */ +unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned char *obuf, unsigned int *olen); + +/** Generate a hash of a file. + @param[in] ctx A pointer to the OpenSSL EVP_MD_CTX object + @param[in] fd The file descriptor + @param[out] olen An optional pointer that stores how long the generated hash is + @return A pointer to a dynamically-created buffer that holds the generated hash + */ +unsigned char *cl_hash_file_fd_ctx(EVP_MD_CTX *ctx, int fd, unsigned int *olen); + +/** Generate a hash of a file. + @param[in] fd The file descriptor + @param[in] alg The hashing algorithm to use + @param[out] olen An optional pointer that stores how long the generated hash is + @return A pointer to a dynamically-created buffer that holds the generated hash + */ +unsigned char *cl_hash_file_fd(int fd, char *alg, unsigned int *olen); + +/** Generate a hash of a file. + @param[in] fp A pointer to a FILE object + @param[in] alg The hashing algorithm to use + @param[out] olen An optional pointer that stores how long the generated hash is + @return A pointer to a dynamically-created buffer that holds the generated hash + */ +unsigned char *cl_hash_file_fp(FILE *fp, char *alg, unsigned int *olen); + +/** Generate a sha256 hash of data + @param[in] buf The data to hash + @param[in] len The length of the to-be-hashed data + @param[out] obuf An optional pointer to store the generated hash. Use NULL to dynamically allocate buffer. + @param[out] olen An optional pointer that stores how long the generated hash is. + @return A pointer to the buffer that holds the generated hash + */ +unsigned char *cl_sha256(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen); + +/** Generate a sha1 hash of data + @param[in] buf The data to hash + @param[in] len The length of the to-be-hashed data + @param[out] obuf An optional pointer to store the generated hash. Use NULL to dynamically allocate buffer. + @param[out] olen An optional pointer that stores how long the generated hash is. + @return A pointer to the buffer that holds the generated hash or obuf if obuf is not NULL + */ +unsigned char *cl_sha1(const void *buf, size_t len, unsigned char *obuf, unsigned int *olen); + +/** Verify validity of signed data + @param[in] pkey The public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] data The data that was signed + @param[in] datalen The length of the data + @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no. + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode); + +/** Verify validity of signed data + @param[in] pkey The public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] digest The hash of the signed data + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_hash(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest); + +/** Verify validity of signed data + @param[in] pkey The public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] fd The file descriptor + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_fd(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, int fd); + +/** Verify validity of signed data + @param[in] x509path The path to the public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] digest The hash of the signed data + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_hash_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest); + +/** Verify validity of signed data + @param[in] x509path The path to the public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] fd The file descriptor + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_fd_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, int fd); + +/** Verify validity of signed data + @param[in] x509path The path to the public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] data The data that was signed + @param[in] datalen The length of the data + @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no. + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_x509_keyfile(char *x509path, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode); + +/** Verify validity of signed data + @param[in] x509 The X509 object of the public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] digest The hash of the signed data + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_hash_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest); + +/** Verify validity of signed data + @param[in] x509 The X509 object of the public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] fd The file descriptor + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_fd_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, int fd); + +/** Verify validity of signed data + @param[in] x509 The X509 object of the public key of the keypair that signed the data + @param[in] alg The algorithm used to hash the data + @param[in] sig The signature block + @param[in] siglen The length of the signature + @param[in] data The data that was signed + @param[in] datalen The length of the data + @param[in] decode Whether or not to base64-decode the signature prior to verification. 1 for yes, 0 for no. + @return 0 for success, -1 for error or invalid signature + */ +int cl_verify_signature_x509(X509 *x509, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode); + +/** Get an X509 object from memory + * @param[in] data A pointer to a spot in memory that contains the PEM X509 cert + * @param[in] len The length of the data + * @return a pointer to the X509 object on success, NULL on error + */ +X509 *cl_get_x509_from_mem(void *data, unsigned int len); + +/** Validate an X509 certificate chain, with the chain being located in a directory + @param[in] tsdir The path to the trust store directory + @param[in] certpath The path to the X509 certificate to be validated. + @return 0 for success, -1 for error or invalid certificate. + */ +int cl_validate_certificate_chain_ts_dir(char *tsdir, char *certpath); + +/** Validate an X509 certificate chain with support for a CRL + @param[in] authorities A NULL-terminated array of strings that hold the path of the CA's X509 certificate + @param[in] crlpath An optional path to the CRL file. NULL if no CRL. + @param[in] certpath The path to the X509 certificate to be validated. + @return 0 for success, -1 for error or invalid certificate. + */ +int cl_validate_certificate_chain(char **authorities, char *crlpath, char *certpath); + +/** Load an X509 certificate from a file + @param[in] certpath The path to the X509 certificate + */ +X509 *cl_load_cert(const char *certpath); + +/** Parse an ASN1_TIME object + @param[in] timeobj The ASN1_TIME object + @return A pointer to a (struct tm). Adjusted for time zone and daylight savings time. + */ +struct tm *cl_ASN1_GetTimeT(ASN1_TIME *timeobj); + +/** Load a CRL file into an X509_CRL object + @param[in] file The path to the CRL + @return A pointer to an X509_CRL object or NULL on error. + */ +X509_CRL *cl_load_crl(const char *timeobj); + +/** Sign data with a key stored on disk + @param[in] keypath The path to the RSA private key + @param[in] alg The hash/signature algorithm to use + @param[in] hash The hash to sign + @param[out] olen A pointer that stores the size of the signature + @param[in] Whether or not to base64-encode the signature. 1 for yes, 0 for no. + @return The generated signature + */ +unsigned char *cl_sign_data_keyfile(char *keypath, char *alg, unsigned char *hash, unsigned int *olen, int encode); + +/** Sign data with an RSA private key object + @param[in] pkey The RSA private key object + @param[in] alg The hash/signature algorithm to use + @param[in] hash The hash to sign + @param[out] olen A pointer that stores the size of the signature + @param[in] Whether or not to base64-encode the signature. 1 for yes, 0 for no. + @return The generated signature + */ +unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsigned int *olen, int encode); + +/** Sign a file with an RSA private key object + @param[in] fd The file descriptor + @param[in] pkey The RSA private key object + @param[in] alg The hash/signature algorithm to use + @param[out] olen A pointer that stores the size of the signature + @param[in] encode Whether or not to base64-encode the signature. 1 for yes, 0 for no. + */ +unsigned char *cl_sign_file_fd(int fd, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode); + +/** Sign a file with an RSA private key object + @param[in] fp A pointer to a FILE object + @param[in] pkey The RSA private key object + @param[in] alg The hash/signature algorithm to use + @param[out] olen A pointer that stores the size of the signature + @param[in] encode Whether or not to base64-encode the signature. 1 for yes, 0 for no. + */ +unsigned char *cl_sign_file_fp(FILE *fp, EVP_PKEY *pkey, char *alg, unsigned int *olen, int encode); + +/** Get the Private Key stored on disk + * @param[in] keypath The path on disk where the private key is stored + * @return A pointer to the EVP_PKEY object that contains the private key in memory + */ +EVP_PKEY *cl_get_pkey_file(char *keypath); + +/** + * @} + */ + +#endif diff --git a/libclamav/cvd.c b/libclamav/cvd.c index dee54d14f..38f54f2b3 100644 --- a/libclamav/cvd.c +++ b/libclamav/cvd.c @@ -35,6 +35,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "dsig.h" @@ -42,7 +46,6 @@ #include "cvd.h" #include "readdb.h" #include "default.h" -#include "sha256.h" #define TAR_BLOCKSIZE 512 @@ -312,7 +315,12 @@ static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, un dbio->readsize = dbio->size < dbio->bufsize ? dbio->size : dbio->bufsize - 1; dbio->bufpt = NULL; dbio->readpt = dbio->buf; - sha256_init(&dbio->sha256ctx); + dbio->hashctx = EVP_MD_CTX_create(); + if (!(dbio->hashctx)) { + cli_tgzload_cleanup(compr, dbio, fdd); + return CL_EMALFDB;; + } + EVP_DigestInit(dbio->hashctx, EVP_sha256()); dbio->bread = 0; /* cli_dbgmsg("cli_tgzload: Loading %s, size: %u\n", name, size); */ @@ -346,7 +354,7 @@ static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, un cli_tgzload_cleanup(compr, dbio, fdd); return CL_EMALFDB; } - sha256_final(&dbio->sha256ctx, hash); + EVP_DigestFinal(dbio->hashctx, hash, NULL); if(memcmp(db->hash, hash, 32)) { cli_errmsg("cli_tgzload: Invalid checksum for file %s\n", name); cli_tgzload_cleanup(compr, dbio, fdd); diff --git a/libclamav/cvd.h b/libclamav/cvd.h index 599dee923..0257b829d 100644 --- a/libclamav/cvd.h +++ b/libclamav/cvd.h @@ -25,8 +25,6 @@ #include #include "clamav.h" -#include "sha256.h" - struct cli_dbio { gzFile gzs; FILE *fs; @@ -34,7 +32,7 @@ struct cli_dbio { char *buf, *bufpt, *readpt; unsigned int usebuf, bufsize, readsize; unsigned int chkonly; - SHA256_CTX sha256ctx; + EVP_MD_CTX *hashctx; }; int cli_cvdload(FILE *fs, struct cl_engine *engine, unsigned int *signo, unsigned int options, unsigned int dbtype, const char *filename, unsigned int chkonly); diff --git a/libclamav/dconf.c b/libclamav/dconf.c index a81475501..189a85113 100644 --- a/libclamav/dconf.c +++ b/libclamav/dconf.c @@ -29,6 +29,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "cltypes.h" #include "dconf.h" diff --git a/libclamav/disasm.c b/libclamav/disasm.c index 6f72fb4b8..fb0ad2f38 100644 --- a/libclamav/disasm.c +++ b/libclamav/disasm.c @@ -26,6 +26,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "disasmpriv.h" diff --git a/libclamav/dlp.c b/libclamav/dlp.c index 91261b7d4..bf6075884 100644 --- a/libclamav/dlp.c +++ b/libclamav/dlp.c @@ -24,6 +24,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include #include #include diff --git a/libclamav/dmg.c b/libclamav/dmg.c index 31514faf9..88aeed7cd 100644 --- a/libclamav/dmg.c +++ b/libclamav/dmg.c @@ -49,6 +49,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "dmg.h" diff --git a/libclamav/dsig.c b/libclamav/dsig.c index 4e7cf39aa..333f4119b 100644 --- a/libclamav/dsig.c +++ b/libclamav/dsig.c @@ -27,12 +27,15 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "dsig.h" #include "str.h" #include "bignum.h" -#include "sha256.h" #define CLI_NSTR "118640995551645342603070001658453189751527774412027743746599405743243142607464144767361060640655844749760788890022283424922762488917565551002467771109669598189410434699034532232228621591089508178591428456220796841621637175567590476666928698770143328137383952820383197532047771780196576957695822641224262693037" @@ -108,7 +111,6 @@ int cli_versig(const char *md5, const char *dsig) mp_int n, e; char *pt, *pt2; - if(strlen(md5) != 32 || !isalnum(md5[0])) { /* someone is trying to fool us with empty/malformed MD5 ? */ cli_errmsg("SECURITY WARNING: MD5 basic test failure.\n"); @@ -156,7 +158,7 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n unsigned char *decoded, digest1[HASH_LEN], digest2[HASH_LEN], digest3[HASH_LEN], *salt; unsigned char mask[BLK_LEN], data[BLK_LEN], final[8 + 2 * HASH_LEN], c[4]; unsigned int i, rounds; - SHA256_CTX ctx; + EVP_MD_CTX *ctx; mp_int n, e; mp_init(&e); @@ -184,10 +186,16 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n for(i = 0; i < rounds; i++) { c[2] = (unsigned char) (i / 256); c[3] = (unsigned char) i; - sha256_init(&ctx); - sha256_update(&ctx, digest2, HASH_LEN); - sha256_update(&ctx, c, 4); - sha256_final(&ctx, digest3); + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + return CL_EVERIFY; + + EVP_DigestInit(ctx, EVP_sha256()); + EVP_DigestUpdate(ctx, digest2, HASH_LEN); + EVP_DigestUpdate(ctx, c, 4); + EVP_DigestFinal(ctx, digest3, NULL); + EVP_MD_CTX_destroy(ctx); if(i + 1 == rounds) memcpy(&data[i * 32], digest3, BLK_LEN - i * HASH_LEN); else @@ -209,9 +217,14 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n memcpy(&final[8], sha256, HASH_LEN); memcpy(&final[8 + HASH_LEN], salt, SALT_LEN); - sha256_init(&ctx); - sha256_update(&ctx, final, sizeof(final)); - sha256_final(&ctx, digest1); + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + return CL_EVERIFY; + + EVP_DigestInit(ctx, EVP_sha256()); + EVP_DigestUpdate(ctx, final, sizeof(final)); + EVP_DigestFinal(ctx, digest1, NULL); + EVP_MD_CTX_destroy(ctx); return memcmp(digest1, digest2, HASH_LEN) ? CL_EVERIFY : CL_SUCCESS; } diff --git a/libclamav/elf.c b/libclamav/elf.c index 33d3e97b3..3fa41577e 100644 --- a/libclamav/elf.c +++ b/libclamav/elf.c @@ -33,6 +33,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "elf.h" #include "clamav.h" diff --git a/libclamav/entconv.c b/libclamav/entconv.c index a8a07765b..7eeb8517a 100644 --- a/libclamav/entconv.c +++ b/libclamav/entconv.c @@ -35,6 +35,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "htmlnorm.h" diff --git a/libclamav/events.c b/libclamav/events.c index a02b7dbac..ccd3b19ef 100644 --- a/libclamav/events.c +++ b/libclamav/events.c @@ -19,14 +19,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ + +#ifndef _WIN32 +#include +#endif + +#include +#include +#include "libclamav/crypto.h" + #include "events.h" #include "others.h" #include "7z/7zCrc.h" #include "str.h" #include -#ifndef _WIN32 -#include -#endif struct cli_event { const char *name; diff --git a/libclamav/explode.c b/libclamav/explode.c index 60499ee01..11e6fd8a6 100644 --- a/libclamav/explode.c +++ b/libclamav/explode.c @@ -38,6 +38,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "explode.h" #include "others.h" diff --git a/libclamav/filetypes.c b/libclamav/filetypes.c index e50a35900..f57e65f22 100644 --- a/libclamav/filetypes.c +++ b/libclamav/filetypes.c @@ -30,6 +30,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "filetypes.h" #include "others.h" diff --git a/libclamav/filtering.c b/libclamav/filtering.c index 39b8ee4a7..472b83131 100644 --- a/libclamav/filtering.c +++ b/libclamav/filtering.c @@ -22,6 +22,11 @@ #if HAVE_CONFIG_H #include "clamav-config.h" #endif + +#include +#include +#include "libclamav/crypto.h" + #include "filtering.h" #include "matcher-ac.h" #include diff --git a/libclamav/fmap.c b/libclamav/fmap.c index 09b230631..29082f9a6 100644 --- a/libclamav/fmap.c +++ b/libclamav/fmap.c @@ -41,6 +41,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "cltypes.h" diff --git a/libclamav/fpu.c b/libclamav/fpu.c index d39495458..be7cbf79e 100644 --- a/libclamav/fpu.c +++ b/libclamav/fpu.c @@ -18,6 +18,10 @@ * MA 02110-1301, USA. */ +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "fpu.h" diff --git a/libclamav/fsg.c b/libclamav/fsg.c index eba0e46ae..c86fbdf3d 100644 --- a/libclamav/fsg.c +++ b/libclamav/fsg.c @@ -40,6 +40,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "rebuildpe.h" #include "others.h" diff --git a/libclamav/gpt.c b/libclamav/gpt.c index b6bb29010..1b06090af 100644 --- a/libclamav/gpt.c +++ b/libclamav/gpt.c @@ -31,6 +31,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "gpt.h" diff --git a/libclamav/hashtab.c b/libclamav/hashtab.c index 87c67f4e1..0919b0ac5 100644 --- a/libclamav/hashtab.c +++ b/libclamav/hashtab.c @@ -25,6 +25,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "clamav.h" #include "others.h" diff --git a/libclamav/hfsplus.c b/libclamav/hfsplus.c index f06028ce8..eb566176f 100644 --- a/libclamav/hfsplus.c +++ b/libclamav/hfsplus.c @@ -22,6 +22,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "hfsplus.h" diff --git a/libclamav/hostid.c b/libclamav/hostid.c index dbd90fbf1..ac5a7f0ee 100644 --- a/libclamav/hostid.c +++ b/libclamav/hostid.c @@ -53,8 +53,11 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "hostid.h" -#include "libclamav/md5.h" #include "libclamav/others.h" struct device *get_device_entry(struct device *devices, size_t *ndevices, const char *name) @@ -245,8 +248,8 @@ char *internal_get_host_id(void) size_t i; unsigned char raw_md5[16]; char *printable_md5; - cli_md5_ctx ctx; struct device *devices; + EVP_MD_CTX ctx; devices = get_devices(); if (!(devices)) @@ -256,11 +259,11 @@ char *internal_get_host_id(void) if (!(printable_md5)) return NULL; - cli_md5_init(&ctx); + EVP_DigestInit(&ctx, EVP_md5()); for (i=0; devices[i].name != NULL; i++) - cli_md5_update(&ctx, devices[i].mac, sizeof(devices[i].mac)); + EVP_DigestUpdate(&ctx, devices[i].mac, sizeof(devices[i].mac)); - cli_md5_final(raw_md5, &ctx); + EVP_DigestFinal(&ctx, raw_md5, NULL); for (i=0; devices[i].name != NULL; i++) free(devices[i].name); diff --git a/libclamav/htmlnorm.c b/libclamav/htmlnorm.c index 084d048fd..f072cfd61 100644 --- a/libclamav/htmlnorm.c +++ b/libclamav/htmlnorm.c @@ -40,6 +40,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "fmap.h" #include "others.h" #include "htmlnorm.h" diff --git a/libclamav/inflate64.c b/libclamav/inflate64.c index d6479ad37..bcb281a83 100644 --- a/libclamav/inflate64.c +++ b/libclamav/inflate64.c @@ -48,6 +48,10 @@ const char inflate64_copyright[] = +#include +#include +#include "libclamav/crypto.h" + #include "inflate64_priv.h" #include /* calloc/free */ diff --git a/libclamav/is_tar.c b/libclamav/is_tar.c index 56d52fef4..37cc92db3 100644 --- a/libclamav/is_tar.c +++ b/libclamav/is_tar.c @@ -20,6 +20,10 @@ #include #include "is_tar.h" +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #define isodigit(c) ( ((c) >= '0') && ((c) <= '7') ) diff --git a/libclamav/ishield.c b/libclamav/ishield.c index b2e370840..33618bc2b 100644 --- a/libclamav/ishield.c +++ b/libclamav/ishield.c @@ -42,6 +42,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "scanners.h" #include "cltypes.h" #include "others.h" diff --git a/libclamav/iso9660.c b/libclamav/iso9660.c index b0596e005..090c1e885 100644 --- a/libclamav/iso9660.c +++ b/libclamav/iso9660.c @@ -19,6 +19,11 @@ */ #include + +#include +#include +#include "libclamav/crypto.h" + #include "scanners.h" #include "iso9660.h" #include "fmap.h" diff --git a/libclamav/jpeg.c b/libclamav/jpeg.c index 7e92f0e92..ada1d9a9e 100644 --- a/libclamav/jpeg.c +++ b/libclamav/jpeg.c @@ -33,6 +33,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "jpeg.h" #include "clamav.h" diff --git a/libclamav/json.c b/libclamav/json.c index b3684f52d..76de8b448 100644 --- a/libclamav/json.c +++ b/libclamav/json.c @@ -29,6 +29,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "libclamav/others.h" #include "libclamav/clamav.h" diff --git a/libclamav/jsparse/js-norm.c b/libclamav/jsparse/js-norm.c index 2c35086ea..ed25919b0 100644 --- a/libclamav/jsparse/js-norm.c +++ b/libclamav/jsparse/js-norm.c @@ -34,6 +34,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "jsparse/lexglobal.h" #include "hashtab.h" diff --git a/libclamav/libclamav.map b/libclamav/libclamav.map index 36b6468d1..656b985a8 100644 --- a/libclamav/libclamav.map +++ b/libclamav/libclamav.map @@ -164,12 +164,6 @@ CLAMAV_PRIVATE { cli_ftw; cli_unlink; cli_writen; - SHA1Init; - SHA1Update; - SHA1Final; - sha256_init; - sha256_update; - sha256_final; cli_url_canon; cli_strerror; decodeLine; @@ -204,6 +198,36 @@ CLAMAV_PRIVATE { cli_disasm_one; cli_utf16_to_utf8; get_fpu_endian; + cl_initialize_crypto; + cl_cleanup_crypto; + cl_hash_data; + cl_hash_file_fd; + cl_hash_file_fp; + cl_hash_file_fd_ctx; + cl_sha256; + cl_sha1; + cl_verify_signature; + cl_verify_signature_x509_keyfile; + cl_verify_signature_x509; + cl_get_x509_from_mem; + cl_validate_certificate_chain_ts_dir; + cl_validate_certificate_chain; + cl_verify_signature_fd; + cl_verify_signature_fd_x509; + cl_verify_signature_fd_x509_keyfile; + cl_verify_signature_hash; + cl_verify_signature_hash_x509; + cl_verify_signature_hash_x509_keyfile; + cl_load_cert; + cl_ASN1_GetTimeT; + cl_load_crl; + sl_sign_data_keyfile; + cl_sign_data; + cl_sign_file_fd; + cl_sign_file_fp; + cl_get_pkey_file; + cl_base64_decode; + cl_base64_encode; local: *; }; diff --git a/libclamav/line.c b/libclamav/line.c index fdc059ec2..bef0c768f 100644 --- a/libclamav/line.c +++ b/libclamav/line.c @@ -63,6 +63,10 @@ static char const rcsid[] = "$Id: line.c,v 1.11 2007/02/12 20:46:08 njh Exp $"; #include #include +#include +#include +#include "libclamav/crypto.h" + #include "line.h" #include "others.h" diff --git a/libclamav/lzma_iface.c b/libclamav/lzma_iface.c index 470ab54ef..25b2b808e 100644 --- a/libclamav/lzma_iface.c +++ b/libclamav/lzma_iface.c @@ -24,6 +24,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include "lzma_iface.h" void *__lzma_wrap_alloc(void *unused, size_t size) { diff --git a/libclamav/macho.c b/libclamav/macho.c index d8ab7c809..ace290f81 100644 --- a/libclamav/macho.c +++ b/libclamav/macho.c @@ -28,6 +28,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "cltypes.h" #include "others.h" diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c index 9b59a0bf3..62259161e 100644 --- a/libclamav/matcher-ac.c +++ b/libclamav/matcher-ac.c @@ -33,6 +33,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "matcher.h" diff --git a/libclamav/matcher-bm.c b/libclamav/matcher-bm.c index 68c8e99bb..9dad28967 100644 --- a/libclamav/matcher-bm.c +++ b/libclamav/matcher-bm.c @@ -24,6 +24,11 @@ #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "memory.h" #include "others.h" diff --git a/libclamav/matcher-hash.c b/libclamav/matcher-hash.c index 83bfb0617..d06e50282 100644 --- a/libclamav/matcher-hash.c +++ b/libclamav/matcher-hash.c @@ -18,13 +18,17 @@ * MA 02110-1301, USA. */ +#include +#include + +#include +#include +#include "libclamav/crypto.h" + #include "matcher.h" #include "others.h" #include "str.h" -#include -#include - int hm_addhash_str(struct cli_matcher *root, const char *strhash, uint32_t size, const char *virusname) { enum CLI_HASH_TYPE type; diff --git a/libclamav/matcher.c b/libclamav/matcher.c index 76f350f6c..4869b890d 100644 --- a/libclamav/matcher.c +++ b/libclamav/matcher.c @@ -30,13 +30,14 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "matcher-ac.h" #include "matcher-bm.h" -#include "md5.h" -#include "sha1.h" -#include "sha256.h" #include "filetypes.h" #include "matcher.h" #include "pe.h" @@ -55,8 +56,6 @@ #include "perflogging.h" #include "bytecode_priv.h" #include "bytecode_api_impl.h" -#include "sha256.h" -#include "sha1.h" #ifdef CLI_PERF_LOGGING @@ -421,8 +420,6 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx) char md5[33]; unsigned int i; const char *virname=NULL; - SHA1Context sha1; - SHA256_CTX sha256; fmap_t *map; const char *ptr; uint8_t shash1[SHA1_HASH_SIZE*2+1]; @@ -459,9 +456,7 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx) if(have_sha1 || have_sha256) { if((ptr = fmap_need_off_once(map, 0, size))) { if(have_sha1) { - SHA1Init(&sha1); - SHA1Update(&sha1, ptr, size); - SHA1Final(&sha1, &shash1[SHA1_HASH_SIZE]); + cl_sha1(ptr, size, shash1, NULL); if(cli_hm_scan(&shash1[SHA1_HASH_SIZE], size, &virname, ctx->engine->hm_fp, CLI_HASH_SHA1) == CL_VIRUS) { cli_dbgmsg("cli_checkfp(sha1): Found false positive detection (fp sig: %s)\n", virname); @@ -478,9 +473,7 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx) } if(have_sha256) { - sha256_init(&sha256); - sha256_update(&sha256, ptr, size); - sha256_final(&sha256, &shash256[SHA256_HASH_SIZE]); + cl_sha256(ptr, size, shash256, NULL); if(cli_hm_scan(&shash256[SHA256_HASH_SIZE], size, &virname, ctx->engine->hm_fp, CLI_HASH_SHA256) == CL_VIRUS) { cli_dbgmsg("cli_checkfp(sha256): Found false positive detection (fp sig: %s)\n", virname); @@ -497,20 +490,14 @@ int cli_checkfp(unsigned char *digest, size_t size, cli_ctx *ctx) #ifdef HAVE__INTERNAL__SHA_COLLECT if((ctx->options & CL_SCAN_INTERNAL_COLLECT_SHA) && ctx->sha_collect>0) { if((ptr = fmap_need_off_once(map, 0, size))) { - if(!have_sha256) { - sha256_init(&sha256); - sha256_update(&sha256, ptr, size); - sha256_final(&sha256, &shash256[SHA256_HASH_SIZE]); - } + if(!have_sha256) + cl_sha256(ptr, size, shash256+SHA256_HASH_SIZE, NULL); for(i=0; ifmap; - struct cli_matcher *hdb, *fp; - const char *virname = NULL; - uint32_t viroffset = 0; - uint32_t viruses_found = 0; + const unsigned char *buff; + int ret = CL_CLEAN, type = CL_CLEAN, bytes, compute_hash[CLI_HASH_AVAIL_TYPES]; + unsigned int i = 0, bm_offmode = 0; + uint32_t maxpatlen, offset = 0; + struct cli_ac_data gdata, tdata; + struct cli_bm_off toff; + unsigned char digest[CLI_HASH_AVAIL_TYPES][32]; + struct cli_matcher *groot = NULL, *troot = NULL; + struct cli_target_info info; + fmap_t *map = *ctx->fmap; + struct cli_matcher *hdb, *fp; + const char *virname = NULL; + uint32_t viroffset = 0; + uint32_t viruses_found = 0; + EVP_MD_CTX *md5ctx, *sha1ctx, *sha256ctx; if(!ctx->engine) { - cli_errmsg("cli_scandesc: engine == NULL\n"); - return CL_ENULLARG; + cli_errmsg("cli_scandesc: engine == NULL\n"); + return CL_ENULLARG; + } + + md5ctx = EVP_MD_CTX_create(); + if (!(md5ctx)) + return CL_CLEAN; + + sha1ctx = EVP_MD_CTX_create(); + if (!(sha1ctx)) { + EVP_MD_CTX_destroy(md5ctx); + return CL_CLEAN; + } + + sha256ctx = EVP_MD_CTX_create(); + if (!(sha256ctx)) { + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + return CL_CLEAN; + } + + if (!EVP_DigestInit(md5ctx, EVP_md5())) { + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + return CL_CLEAN; + } + + if (!EVP_DigestInit(sha1ctx, EVP_sha1())) { + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + return CL_CLEAN; + } + + if (!EVP_DigestInit(sha256ctx, EVP_sha256())) { + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + return CL_CLEAN; } if(!ftonly) - groot = ctx->engine->root[0]; /* generic signatures */ + groot = ctx->engine->root[0]; /* generic signatures */ if(ftype) { - for(i = 1; i < CLI_MTARGETS; i++) { - if(cli_mtargets[i].target == ftype) { - troot = ctx->engine->root[i]; - break; - } - } + for(i = 1; i < CLI_MTARGETS; i++) { + if(cli_mtargets[i].target == ftype) { + troot = ctx->engine->root[i]; + break; + } + } } if(ftonly) { - if(!troot) - return CL_CLEAN; + if(!troot) + return CL_CLEAN; - maxpatlen = troot->maxpatlen; + maxpatlen = troot->maxpatlen; } else { - if(troot) - maxpatlen = MAX(troot->maxpatlen, groot->maxpatlen); - else - maxpatlen = groot->maxpatlen; + if(troot) + maxpatlen = MAX(troot->maxpatlen, groot->maxpatlen); + else + maxpatlen = groot->maxpatlen; } cli_targetinfo(&info, i, map); - if(!ftonly) - if((ret = cli_ac_initdata(&gdata, groot->ac_partsigs, groot->ac_lsigs, groot->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN)) || (ret = cli_ac_caloff(groot, &gdata, &info))) { - if(info.exeinfo.section) - free(info.exeinfo.section); - cli_hashset_destroy(&info.exeinfo.vinfo); - return ret; - } + if(!ftonly) { + if((ret = cli_ac_initdata(&gdata, groot->ac_partsigs, groot->ac_lsigs, groot->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN)) || (ret = cli_ac_caloff(groot, &gdata, &info))) { + if(info.exeinfo.section) + free(info.exeinfo.section); + + cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + return ret; + } + } if(troot) { - if((ret = cli_ac_initdata(&tdata, troot->ac_partsigs, troot->ac_lsigs, troot->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN)) || (ret = cli_ac_caloff(troot, &tdata, &info))) { - if(!ftonly) - cli_ac_freedata(&gdata); - if(info.exeinfo.section) - free(info.exeinfo.section); - cli_hashset_destroy(&info.exeinfo.vinfo); - return ret; - } - if(troot->bm_offmode) { - if(map->len >= CLI_DEFAULT_BM_OFFMODE_FSIZE) { - if((ret = cli_bm_initoff(troot, &toff, &info))) { - if(!ftonly) - cli_ac_freedata(&gdata); - cli_ac_freedata(&tdata); - if(info.exeinfo.section) - free(info.exeinfo.section); - cli_hashset_destroy(&info.exeinfo.vinfo); - return ret; - } - bm_offmode = 1; - } - } + if((ret = cli_ac_initdata(&tdata, troot->ac_partsigs, troot->ac_lsigs, troot->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN)) || (ret = cli_ac_caloff(troot, &tdata, &info))) { + if(!ftonly) + cli_ac_freedata(&gdata); + if(info.exeinfo.section) + free(info.exeinfo.section); + + cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + return ret; + } + if(troot->bm_offmode) { + if(map->len >= CLI_DEFAULT_BM_OFFMODE_FSIZE) { + if((ret = cli_bm_initoff(troot, &toff, &info))) { + if(!ftonly) + cli_ac_freedata(&gdata); + + cli_ac_freedata(&tdata); + if(info.exeinfo.section) + free(info.exeinfo.section); + + cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + return ret; + } + + bm_offmode = 1; + } + } } hdb = ctx->engine->hm_hdb; fp = ctx->engine->hm_fp; if(!ftonly && hdb) { - if(!refhash) { - if(cli_hm_have_size(hdb, CLI_HASH_MD5, map->len) || cli_hm_have_size(fp, CLI_HASH_MD5, map->len)) { - cli_md5_init(&md5ctx); - compute_hash[CLI_HASH_MD5] = 1; - } else - compute_hash[CLI_HASH_MD5] = 0; - } else { - compute_hash[CLI_HASH_MD5] = 0; - memcpy(digest[CLI_HASH_MD5], refhash, 16); - } + if(!refhash) { + if(cli_hm_have_size(hdb, CLI_HASH_MD5, map->len) || cli_hm_have_size(fp, CLI_HASH_MD5, map->len)) { + compute_hash[CLI_HASH_MD5] = 1; + } else { + compute_hash[CLI_HASH_MD5] = 0; + } + } else { + compute_hash[CLI_HASH_MD5] = 0; + memcpy(digest[CLI_HASH_MD5], refhash, 16); + } - if(cli_hm_have_size(hdb, CLI_HASH_SHA1, map->len) || cli_hm_have_wild(hdb, CLI_HASH_SHA1) - || cli_hm_have_size(fp, CLI_HASH_SHA1, map->len) || cli_hm_have_wild(fp, CLI_HASH_SHA1) ) { - SHA1Init(&sha1ctx); - compute_hash[CLI_HASH_SHA1] = 1; - } else - compute_hash[CLI_HASH_SHA1] = 0; - - if(cli_hm_have_size(hdb, CLI_HASH_SHA256, map->len) || cli_hm_have_wild(hdb, CLI_HASH_SHA256) - || cli_hm_have_size(fp, CLI_HASH_SHA256, map->len) || cli_hm_have_wild(fp, CLI_HASH_SHA256)) { - sha256_init(&sha256ctx); - compute_hash[CLI_HASH_SHA256] = 1; - } else - compute_hash[CLI_HASH_SHA256] = 0; + if(cli_hm_have_size(hdb, CLI_HASH_SHA1, map->len) || cli_hm_have_wild(hdb, CLI_HASH_SHA1) + || cli_hm_have_size(fp, CLI_HASH_SHA1, map->len) || cli_hm_have_wild(fp, CLI_HASH_SHA1) ) { + compute_hash[CLI_HASH_SHA1] = 1; + } else { + compute_hash[CLI_HASH_SHA1] = 0; + } + + if(cli_hm_have_size(hdb, CLI_HASH_SHA256, map->len) || cli_hm_have_wild(hdb, CLI_HASH_SHA256) + || cli_hm_have_size(fp, CLI_HASH_SHA256, map->len) || cli_hm_have_wild(fp, CLI_HASH_SHA256)) { + compute_hash[CLI_HASH_SHA256] = 1; + } else { + compute_hash[CLI_HASH_SHA256] = 0; + } } while(offset < map->len) { - bytes = MIN(map->len - offset, SCANBUFF); - if(!(buff = fmap_need_off_once(map, offset, bytes))) - break; - if(ctx->scanned) - *ctx->scanned += bytes / CL_COUNT_PRECISION; + bytes = MIN(map->len - offset, SCANBUFF); + if(!(buff = fmap_need_off_once(map, offset, bytes))) + break; + if(ctx->scanned) + *ctx->scanned += bytes / CL_COUNT_PRECISION; + + if(troot) { + virname = NULL; + viroffset = 0; + ret = matcher_run(troot, buff, bytes, &virname, &tdata, offset, &info, ftype, ftoffset, acmode, acres, map, bm_offmode ? &toff : NULL, &viroffset, ctx); + + if (virname) { + /* virname already appended by matcher_run */ + viruses_found = 1; + } + if((ret == CL_VIRUS && !SCAN_ALL) || ret == CL_EMEM) { + if(!ftonly) + cli_ac_freedata(&gdata); + + cli_ac_freedata(&tdata); + if(bm_offmode) + cli_bm_freeoff(&toff); + + if(info.exeinfo.section) + free(info.exeinfo.section); + + cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + return ret; + } + } - if(troot) { + if(!ftonly) { virname = NULL; viroffset = 0; - ret = matcher_run(troot, buff, bytes, &virname, &tdata, offset, &info, ftype, ftoffset, acmode, acres, map, bm_offmode ? &toff : NULL, &viroffset, ctx); + ret = matcher_run(groot, buff, bytes, &virname, &gdata, offset, &info, ftype, ftoffset, acmode, acres, map, NULL, &viroffset, ctx); - if (virname) { - /* virname already appended by matcher_run */ - viruses_found = 1; - } - if((ret == CL_VIRUS && !SCAN_ALL) || ret == CL_EMEM) { - if(!ftonly) - cli_ac_freedata(&gdata); - cli_ac_freedata(&tdata); - if(bm_offmode) - cli_bm_freeoff(&toff); - if(info.exeinfo.section) - free(info.exeinfo.section); - cli_hashset_destroy(&info.exeinfo.vinfo); - return ret; - } - } + if (virname) { + /* virname already appended by matcher_run */ + viruses_found = 1; + } + if((ret == CL_VIRUS && !SCAN_ALL) || ret == CL_EMEM) { + cli_ac_freedata(&gdata); + if(troot) { + cli_ac_freedata(&tdata); + if(bm_offmode) + cli_bm_freeoff(&toff); + } - if(!ftonly) { - virname = NULL; - viroffset = 0; - ret = matcher_run(groot, buff, bytes, &virname, &gdata, offset, &info, ftype, ftoffset, acmode, acres, map, NULL, &viroffset, ctx); + if(info.exeinfo.section) + free(info.exeinfo.section); - if (virname) { - /* virname already appended by matcher_run */ - viruses_found = 1; - } - if((ret == CL_VIRUS && !SCAN_ALL) || ret == CL_EMEM) { - cli_ac_freedata(&gdata); - if(troot) { - cli_ac_freedata(&tdata); - if(bm_offmode) - cli_bm_freeoff(&toff); - } - if(info.exeinfo.section) - free(info.exeinfo.section); - cli_hashset_destroy(&info.exeinfo.vinfo); - return ret; - } else if((acmode & AC_SCAN_FT) && ret >= CL_TYPENO) { - if(ret > type) - type = ret; - } + cli_hashset_destroy(&info.exeinfo.vinfo); + return ret; + } else if((acmode & AC_SCAN_FT) && ret >= CL_TYPENO) { + if(ret > type) + type = ret; + } - if(hdb && !SCAN_ALL) { - const void *data = buff + maxpatlen * (offset!=0); - uint32_t data_len = bytes - maxpatlen * (offset!=0); + if(hdb && !SCAN_ALL) { + const void *data = buff + maxpatlen * (offset!=0); + uint32_t data_len = bytes - maxpatlen * (offset!=0); - if(compute_hash[CLI_HASH_MD5]) - cli_md5_update(&md5ctx, data, data_len); - if(compute_hash[CLI_HASH_SHA1]) - SHA1Update(&sha1ctx, data, data_len); - if(compute_hash[CLI_HASH_SHA256]) - sha256_update(&sha256ctx, data, data_len); - } - } + if(compute_hash[CLI_HASH_MD5]) + EVP_DigestUpdate(md5ctx, data, data_len); + if(compute_hash[CLI_HASH_SHA1]) + EVP_DigestUpdate(sha1ctx, data, data_len); + if(compute_hash[CLI_HASH_SHA256]) + EVP_DigestUpdate(sha256ctx, data, data_len); + } + } - if(SCAN_ALL && viroffset) { - offset = viroffset; - continue; - } - if(bytes < SCANBUFF) break; - offset += bytes - maxpatlen; + if(SCAN_ALL && viroffset) { + offset = viroffset; + continue; + } + + if(bytes < SCANBUFF) + break; + + offset += bytes - maxpatlen; } if(!ftonly && hdb) { - enum CLI_HASH_TYPE hashtype, hashtype2; - - if(compute_hash[CLI_HASH_MD5]) - cli_md5_final(digest[CLI_HASH_MD5], &md5ctx); - if(refhash) - compute_hash[CLI_HASH_MD5] = 1; - if(compute_hash[CLI_HASH_SHA1]) - SHA1Final(&sha1ctx, digest[CLI_HASH_SHA1]); - if(compute_hash[CLI_HASH_SHA256]) - sha256_final(&sha256ctx, digest[CLI_HASH_SHA256]); - - virname = NULL; - for(hashtype = CLI_HASH_MD5; hashtype < CLI_HASH_AVAIL_TYPES; hashtype++) { - const char * virname_w = NULL; - int found = 0; - - /* If no hash, skip to next type */ - if(!compute_hash[hashtype]) - continue; + enum CLI_HASH_TYPE hashtype, hashtype2; + + if(compute_hash[CLI_HASH_MD5]) + EVP_DigestFinal(md5ctx, digest[CLI_HASH_MD5], NULL); + if(refhash) + compute_hash[CLI_HASH_MD5] = 1; + if(compute_hash[CLI_HASH_SHA1]) + EVP_DigestFinal(sha1ctx, digest[CLI_HASH_SHA1], NULL); + if(compute_hash[CLI_HASH_SHA256]) + EVP_DigestFinal(sha256ctx, digest[CLI_HASH_SHA256], NULL); + + virname = NULL; + for(hashtype = CLI_HASH_MD5; hashtype < CLI_HASH_AVAIL_TYPES; hashtype++) { + const char * virname_w = NULL; + int found = 0; + + /* If no hash, skip to next type */ + if(!compute_hash[hashtype]) + continue; + + /* Do hash scan */ + if((ret = cli_hm_scan(digest[hashtype], map->len, &virname, hdb, hashtype)) == CL_VIRUS) { + found += 1; + } + if(!found || SCAN_ALL) { + if ((ret = cli_hm_scan_wild(digest[hashtype], &virname_w, hdb, hashtype)) == CL_VIRUS) + found += 2; + } - /* Do hash scan */ - if((ret = cli_hm_scan(digest[hashtype], map->len, &virname, hdb, hashtype)) == CL_VIRUS) { - found += 1; - } - if(!found || SCAN_ALL) { - if ((ret = cli_hm_scan_wild(digest[hashtype], &virname_w, hdb, hashtype)) == CL_VIRUS) - found += 2; - } + /* If found, do immediate hash-only FP check */ + if (found && fp) { + for(hashtype2 = CLI_HASH_MD5; hashtype2 < CLI_HASH_AVAIL_TYPES; hashtype2++) { + if(!compute_hash[hashtype2]) + continue; + if(cli_hm_scan(digest[hashtype2], map->len, NULL, fp, hashtype2) == CL_VIRUS) { + found = 0; + ret = CL_CLEAN; + break; + } + else if(cli_hm_scan_wild(digest[hashtype2], NULL, fp, hashtype2) == CL_VIRUS) { + found = 0; + ret = CL_CLEAN; + break; + } + } + } - /* If found, do immediate hash-only FP check */ - if (found && fp) { - for(hashtype2 = CLI_HASH_MD5; hashtype2 < CLI_HASH_AVAIL_TYPES; hashtype2++) { - if(!compute_hash[hashtype2]) - continue; - if(cli_hm_scan(digest[hashtype2], map->len, NULL, fp, hashtype2) == CL_VIRUS) { - found = 0; - ret = CL_CLEAN; - break; - } - else if(cli_hm_scan_wild(digest[hashtype2], NULL, fp, hashtype2) == CL_VIRUS) { - found = 0; - ret = CL_CLEAN; - break; - } - } - } + /* If matched size-based hash ... */ + if (found % 2) { + viruses_found = 1; + cli_append_virus(ctx, virname); + if (!SCAN_ALL) + break; + virname = NULL; + } + /* If matched size-agnostic hash ... */ + if (found > 1) { + viruses_found = 1; + cli_append_virus(ctx, virname_w); - /* If matched size-based hash ... */ - if (found % 2) { - viruses_found = 1; - cli_append_virus(ctx, virname); - if (!SCAN_ALL) - break; - virname = NULL; - } - /* If matched size-agnostic hash ... */ - if (found > 1) { - viruses_found = 1; - cli_append_virus(ctx, virname_w); - if (!SCAN_ALL) - break; - } - } + if (!SCAN_ALL) + break; + } + } } + EVP_MD_CTX_destroy(md5ctx); + EVP_MD_CTX_destroy(sha1ctx); + EVP_MD_CTX_destroy(sha256ctx); + if(troot) { - if(ret != CL_VIRUS || SCAN_ALL) - ret = cli_lsig_eval(ctx, troot, &tdata, &info, refhash); - if (ret == CL_VIRUS) - viruses_found++; - cli_ac_freedata(&tdata); - if(bm_offmode) - cli_bm_freeoff(&toff); + if(ret != CL_VIRUS || SCAN_ALL) + ret = cli_lsig_eval(ctx, troot, &tdata, &info, refhash); + if (ret == CL_VIRUS) + viruses_found++; + + cli_ac_freedata(&tdata); + if(bm_offmode) + cli_bm_freeoff(&toff); } if(groot) { - if(ret != CL_VIRUS || SCAN_ALL) - ret = cli_lsig_eval(ctx, groot, &gdata, &info, refhash); - cli_ac_freedata(&gdata); + if(ret != CL_VIRUS || SCAN_ALL) + ret = cli_lsig_eval(ctx, groot, &gdata, &info, refhash); + cli_ac_freedata(&gdata); } if(info.exeinfo.section) - free(info.exeinfo.section); + free(info.exeinfo.section); + cli_hashset_destroy(&info.exeinfo.vinfo); if (SCAN_ALL && viruses_found) - return CL_VIRUS; + return CL_VIRUS; if(ret == CL_VIRUS) - return CL_VIRUS; + return CL_VIRUS; return (acmode & AC_SCAN_FT) ? type : CL_CLEAN; } diff --git a/libclamav/mbox.c b/libclamav/mbox.c index 423973aa6..6f2224379 100644 --- a/libclamav/mbox.c +++ b/libclamav/mbox.c @@ -30,8 +30,6 @@ static char const rcsid[] = "$Id: mbox.c,v 1.381 2007/02/15 12:26:44 njh Exp $"; #endif #endif -#define _GNU_SOURCE - #include #include #include @@ -66,12 +64,15 @@ static char const rcsid[] = "$Id: mbox.c,v 1.381 2007/02/15 12:26:44 njh Exp $"; #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "str.h" #include "filetypes.h" #include "mbox.h" #include "dconf.h" -#include "md5.h" #include "fmap.h" #define DCONF_PHISHING mctx->ctx->dconf->phishing @@ -2795,7 +2796,7 @@ rfc1341(message *m, const char *dir) int n; char pdir[NAME_MAX + 1]; unsigned char md5_val[16]; - cli_md5_ctx md5; + EVP_MD_CTX *ctx; char *md5_hex; id = (char *)messageFindArgument(m, "id"); @@ -2852,9 +2853,14 @@ rfc1341(message *m, const char *dir) } n = atoi(number); - cli_md5_init(&md5); - cli_md5_update(&md5, id, strlen(id)); - cli_md5_final(md5_val, &md5); + ctx = EVP_MD_CTX_create(); + if (!(ctx)) { + free(id); + return CL_EMEM; + } + EVP_DigestInit(ctx, EVP_md5()); + EVP_DigestUpdate(ctx, id, strlen(id)); + EVP_DigestFinal(ctx, md5_val, NULL); md5_hex = cli_str2hex((const char*)md5_val, 16); if(!md5_hex) { diff --git a/libclamav/md5.c b/libclamav/md5.c deleted file mode 100644 index e83c44e72..000000000 --- a/libclamav/md5.c +++ /dev/null @@ -1,284 +0,0 @@ -/* - * This is an OpenSSL-compatible implementation of the RSA Data Security, - * Inc. MD5 Message-Digest Algorithm (RFC 1321). - * - * Written by Solar Designer in 2001, and placed - * in the public domain. There's absolutely no warranty. - * - * This differs from Colin Plumb's older public domain implementation in - * that no 32-bit integer data type is required, there's no compile-time - * endianness configuration, and the function prototypes match OpenSSL's. - * The primary goals are portability and ease of use. - * - * This implementation is meant to be fast, but not as fast as possible. - * Some known optimizations are not included to reduce source code size - * and avoid compile-time configuration. - * - * Updated in 2012 to meet the needs of ClamAV. - */ - -#include - -#include "md5.h" -#include "iowrap.h" - -/* - * The basic MD5 functions. - * - * F and G are optimized compared to their RFC 1321 definitions for - * architectures that lack an AND-NOT instruction, just like in Colin Plumb's - * implementation. - */ -#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | ~(z))) - -/* - * The MD5 transformation for all four rounds. - */ -#define STEP(f, a, b, c, d, x, t, s) \ - (a) += f((b), (c), (d)) + (x) + (t); \ - (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ - (a) += (b); - -/* - * SET reads 4 input bytes in little-endian byte order and stores them - * in a properly aligned word in host byte order. - * - * The check for little-endian architectures that tolerate unaligned - * memory accesses is just an optimization. Nothing will break if it - * doesn't work. - */ -#if defined(__i386__) || defined(__x86_64__) || defined(__vax__) -#define SET(n) \ - (*(const MD5_u32plus *)&chunk[(n) * 4]) -#define GET(n) \ - SET(n) -#else -#define SET(n) \ - (ctx->block[(n)] = \ - (MD5_u32plus)chunk[(n) * 4] | \ - ((MD5_u32plus)chunk[(n) * 4 + 1] << 8) | \ - ((MD5_u32plus)chunk[(n) * 4 + 2] << 16) | \ - ((MD5_u32plus)chunk[(n) * 4 + 3] << 24)) -#define GET(n) \ - (ctx->block[(n)]) -#endif - -/* - * This processes one or more 64-byte data blocks, but does NOT update - * the bit counters. There are no alignment requirements. - * Returns NULL on a read error, or a pointer to the next byte if successful. - */ -static const void *body(cli_md5_ctx *ctx, const void *data, unsigned long size) -{ - const unsigned char *ptr; - MD5_u32plus a, b, c, d; - MD5_u32plus saved_a, saved_b, saved_c, saved_d; - unsigned char chunk[64]; - - ptr = data; - - a = ctx->a; - b = ctx->b; - c = ctx->c; - d = ctx->d; - - do { - saved_a = a; - saved_b = b; - saved_c = c; - saved_d = d; - - if(cli_memcpy(chunk, ptr, 64)) - return NULL; -/* Round 1 */ - STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) - STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) - STEP(F, c, d, a, b, SET(2), 0x242070db, 17) - STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) - STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) - STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) - STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) - STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) - STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) - STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) - STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) - STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) - STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) - STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) - STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) - STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) - -/* Round 2 */ - STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) - STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) - STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) - STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) - STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) - STEP(G, d, a, b, c, GET(10), 0x02441453, 9) - STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) - STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) - STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) - STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) - STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) - STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) - STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) - STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) - STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) - STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) - -/* Round 3 */ - STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) - STEP(H, d, a, b, c, GET(8), 0x8771f681, 11) - STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) - STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23) - STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) - STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11) - STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) - STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23) - STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) - STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11) - STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) - STEP(H, b, c, d, a, GET(6), 0x04881d05, 23) - STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) - STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11) - STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) - STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23) - -/* Round 4 */ - STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) - STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) - STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) - STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) - STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) - STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) - STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) - STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) - STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) - STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) - STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) - STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) - STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) - STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) - STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) - STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) - - a += saved_a; - b += saved_b; - c += saved_c; - d += saved_d; - - ptr += 64; - } while (size -= 64); - - ctx->a = a; - ctx->b = b; - ctx->c = c; - ctx->d = d; - - return ptr; -} - -void cli_md5_init(cli_md5_ctx *ctx) -{ - ctx->a = 0x67452301; - ctx->b = 0xefcdab89; - ctx->c = 0x98badcfe; - ctx->d = 0x10325476; - - ctx->lo = 0; - ctx->hi = 0; -} - -int cli_md5_update(cli_md5_ctx *ctx, const void *data, unsigned long size) -{ - MD5_u32plus saved_lo; - unsigned long used, free; - int invalid = 0; - - saved_lo = ctx->lo; - if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) - ctx->hi++; - ctx->hi += size >> 29; - - used = saved_lo & 0x3f; - - if (used) { - free = 64 - used; - - if (size < free) { - invalid = cli_memcpy(&ctx->buffer[used], data, size); - return invalid; - } - - invalid = cli_memcpy(&ctx->buffer[used], data, free); - if (invalid) - return invalid; - data = (const unsigned char *)data + free; - size -= free; - if (body(ctx, ctx->buffer, 64) == NULL) - return 1; - } - - if (size >= 64) { - data = body(ctx, data, size & ~(unsigned long)0x3f); - if (data == NULL) - return 1; - size &= 0x3f; - } - - return cli_memcpy(ctx->buffer, data, size); -} - -void cli_md5_final(unsigned char *result, cli_md5_ctx *ctx) -{ - unsigned long used, free; - - used = ctx->lo & 0x3f; - - ctx->buffer[used++] = 0x80; - - free = 64 - used; - - if (free < 8) { - memset(&ctx->buffer[used], 0, free); - body(ctx, ctx->buffer, 64); - used = 0; - free = 64; - } - - memset(&ctx->buffer[used], 0, free - 8); - - ctx->lo <<= 3; - ctx->buffer[56] = ctx->lo; - ctx->buffer[57] = ctx->lo >> 8; - ctx->buffer[58] = ctx->lo >> 16; - ctx->buffer[59] = ctx->lo >> 24; - ctx->buffer[60] = ctx->hi; - ctx->buffer[61] = ctx->hi >> 8; - ctx->buffer[62] = ctx->hi >> 16; - ctx->buffer[63] = ctx->hi >> 24; - - body(ctx, ctx->buffer, 64); - - result[0] = ctx->a; - result[1] = ctx->a >> 8; - result[2] = ctx->a >> 16; - result[3] = ctx->a >> 24; - result[4] = ctx->b; - result[5] = ctx->b >> 8; - result[6] = ctx->b >> 16; - result[7] = ctx->b >> 24; - result[8] = ctx->c; - result[9] = ctx->c >> 8; - result[10] = ctx->c >> 16; - result[11] = ctx->c >> 24; - result[12] = ctx->d; - result[13] = ctx->d >> 8; - result[14] = ctx->d >> 16; - result[15] = ctx->d >> 24; - - memset(ctx, 0, sizeof(*ctx)); -} diff --git a/libclamav/md5.h b/libclamav/md5.h deleted file mode 100644 index 82589751d..000000000 --- a/libclamav/md5.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This is an OpenSSL-compatible implementation of the RSA Data Security, - * Inc. MD5 Message-Digest Algorithm (RFC 1321). - * - * Written by Solar Designer in 2001, and placed - * in the public domain. There's absolutely no warranty. - * - * Updated in 2012 to meet the needs of ClamAV. - * - * See md5.c for more information. - */ - -#ifndef __MD5_H -#define __MD5_H - -/* Any 32-bit or wider unsigned integer data type will do */ -typedef unsigned int MD5_u32plus; - -typedef struct { - MD5_u32plus lo, hi; - MD5_u32plus a, b, c, d; - unsigned char buffer[64]; - MD5_u32plus block[16]; -} cli_md5_ctx; - -extern void cli_md5_init(cli_md5_ctx *ctx); -extern int cli_md5_update(cli_md5_ctx *ctx, const void *data, unsigned long size); -extern void cli_md5_final(unsigned char *result, cli_md5_ctx *ctx); - -#endif diff --git a/libclamav/message.c b/libclamav/message.c index fd046662c..4e2d9f231 100644 --- a/libclamav/message.c +++ b/libclamav/message.c @@ -47,6 +47,10 @@ static char const rcsid[] = "$Id: message.c,v 1.195 2007/02/12 20:46:09 njh Exp #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "str.h" #include "filetypes.h" diff --git a/libclamav/mew.c b/libclamav/mew.c index a56d42853..e648061b1 100644 --- a/libclamav/mew.c +++ b/libclamav/mew.c @@ -48,6 +48,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "pe.h" #include "others.h" diff --git a/libclamav/mpool.c b/libclamav/mpool.c index b0ed837b4..eebd35ebe 100644 --- a/libclamav/mpool.c +++ b/libclamav/mpool.c @@ -40,6 +40,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "str.h" #include "readdb.h" diff --git a/libclamav/msexpand.c b/libclamav/msexpand.c index 3b7ef8f3c..930fc77e9 100644 --- a/libclamav/msexpand.c +++ b/libclamav/msexpand.c @@ -29,6 +29,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "cltypes.h" #include "others.h" diff --git a/libclamav/mspack.c b/libclamav/mspack.c index e7926d1e1..e0f5bfefc 100644 --- a/libclamav/mspack.c +++ b/libclamav/mspack.c @@ -26,6 +26,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "clamav.h" #include "mspack.h" diff --git a/libclamav/nsis/bzlib.c b/libclamav/nsis/bzlib.c index 93103f44b..dd91e506a 100644 --- a/libclamav/nsis/bzlib.c +++ b/libclamav/nsis/bzlib.c @@ -30,6 +30,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include "bzlib_private.h" #include "others.h" diff --git a/libclamav/nsis/nulsft.c b/libclamav/nsis/nulsft.c index 5c1ee3f87..9e68f60ab 100644 --- a/libclamav/nsis/nulsft.c +++ b/libclamav/nsis/nulsft.c @@ -31,6 +31,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "cltypes.h" #include "nsis_bzlib.h" diff --git a/libclamav/ole2_extract.c b/libclamav/ole2_extract.c index b2f812303..c395e5b2f 100644 --- a/libclamav/ole2_extract.c +++ b/libclamav/ole2_extract.c @@ -35,6 +35,10 @@ #include #include "clamav.h" +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "ole2_extract.h" diff --git a/libclamav/others.c b/libclamav/others.c index 1781e0abd..6bb5155b5 100644 --- a/libclamav/others.c +++ b/libclamav/others.c @@ -61,11 +61,12 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" -#include "md5.h" -#include "sha1.h" -#include "sha256.h" #include "cltypes.h" #include "regex/regex.h" #include "ltdl.h" @@ -859,53 +860,40 @@ int cli_updatelimits(cli_ctx *ctx, unsigned long needed) { */ char *cli_hashstream(FILE *fs, unsigned char *digcpy, int type) { - unsigned char digest[32]; - char buff[FILEBUFF]; - cli_md5_ctx md5; - SHA1Context sha1; - SHA256_CTX sha256; - char *hashstr, *pt; - int i, bytes, size; - + unsigned char digest[32]; + char buff[FILEBUFF]; + char *hashstr, *pt; + int i, bytes, size; + EVP_MD_CTX *ctx; + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + return NULL; if(type == 1) - cli_md5_init(&md5); + EVP_DigestInit(ctx, EVP_md5()); else if(type == 2) - SHA1Init(&sha1); + EVP_DigestInit(ctx, EVP_sha1()); else - sha256_init(&sha256); - - while((bytes = fread(buff, 1, FILEBUFF, fs))) { - if(type == 1) - cli_md5_update(&md5, buff, bytes); - else if(type == 2) - SHA1Update(&sha1, buff, bytes); - else - sha256_update(&sha256, buff, bytes); - } + EVP_DigestInit(ctx, EVP_sha256()); - if(type == 1) { - cli_md5_final(digest, &md5); - size = 16; - } else if(type == 2) { - SHA1Final(&sha1, digest); - size = 20; - } else { - sha256_final(&sha256, digest); - size = 32; - } + while((bytes = fread(buff, 1, FILEBUFF, fs))) + EVP_DigestUpdate(ctx, buff, bytes); + + EVP_DigestFinal(ctx, digest, &size); + EVP_MD_CTX_destroy(ctx); if(!(hashstr = (char *) cli_calloc(size*2 + 1, sizeof(char)))) - return NULL; + return NULL; pt = hashstr; for(i = 0; i < size; i++) { - sprintf(pt, "%02x", digest[i]); - pt += 2; + sprintf(pt, "%02x", digest[i]); + pt += 2; } if(digcpy) - memcpy(digcpy, digest, size); + memcpy(digcpy, digest, size); return hashstr; } @@ -1267,3 +1255,13 @@ void cl_engine_set_clcb_meta(struct cl_engine *engine, clcb_meta callback) { engine->cb_meta = callback; } + +__attribute__((constructor)) void init(void) +{ + cl_initialize_crypto(); +} + +__attribute__((destructor)) void deinit(void) +{ + cl_cleanup_crypto(); +} diff --git a/libclamav/others_common.c b/libclamav/others_common.c index 4f02aaf11..d7cc5c23f 100644 --- a/libclamav/others_common.c +++ b/libclamav/others_common.c @@ -52,14 +52,16 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" -#include "md5.h" #include "cltypes.h" #include "regex/regex.h" #include "ltdl.h" #include "matcher-ac.h" -#include "md5.h" static unsigned char name_salt[16] = { 16, 38, 97, 12, 8, 4, 72, 196, 217, 144, 33, 124, 18, 11, 17, 253 }; @@ -823,13 +825,9 @@ static char *cli_md5buff(const unsigned char *buffer, unsigned int len, unsigned { unsigned char digest[16]; char *md5str, *pt; - cli_md5_ctx ctx; int i; - - cli_md5_init(&ctx); - cli_md5_update(&ctx, buffer, len); - cli_md5_final(digest, &ctx); + cl_hash_data("md5", buffer, len, digest, NULL); if(dig) memcpy(dig, digest, 16); diff --git a/libclamav/packlibs.c b/libclamav/packlibs.c index f5aaa30e5..4204828d1 100644 --- a/libclamav/packlibs.c +++ b/libclamav/packlibs.c @@ -22,6 +22,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "execs.h" #include "pe.h" diff --git a/libclamav/pdf.c b/libclamav/pdf.c index c64df8ddd..cf826e893 100644 --- a/libclamav/pdf.c +++ b/libclamav/pdf.c @@ -44,6 +44,10 @@ static char const rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $"; #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "pdf.h" @@ -52,10 +56,8 @@ static char const rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $"; #include "str.h" #include "bytecode.h" #include "bytecode_api.h" -#include "md5.h" #include "arc4.h" #include "rijndael.h" -#include "sha256.h" #include "textnorm.h" @@ -665,7 +667,6 @@ static char *decrypt_any(struct pdf_struct *pdf, uint32_t id, const char *in, of { unsigned char *key, *q, result[16]; unsigned n; - cli_md5_ctx md5; struct arc4_state arc4; if (!length || !*length || !in) { @@ -690,9 +691,7 @@ static char *decrypt_any(struct pdf_struct *pdf, uint32_t id, const char *in, of *q++ = 0; if (enc_method == ENC_AESV2) memcpy(q, "sAlT", 4); - cli_md5_init(&md5); - cli_md5_update(&md5, key, n); - cli_md5_final(result, &md5); + cl_hash_data("md5", key, n, result, NULL); free(key); n = pdf->keylen + 5; @@ -1722,7 +1721,6 @@ static void check_user_password(struct pdf_struct *pdf, int R, const char *O, unsigned i; uint8_t result[16]; char data[32]; - cli_md5_ctx md5; struct arc4_state arc4; unsigned password_empty = 0; @@ -1730,20 +1728,15 @@ static void check_user_password(struct pdf_struct *pdf, int R, const char *O, dbg_printhex("O: ", O, 32); if (R == 5) { uint8_t result2[32]; - SHA256_CTX sha256; /* supplement to ISO3200, 3.5.2 Algorithm 3.11 */ - sha256_init(&sha256); /* user validation salt */ - sha256_update(&sha256, U+32, 8); - sha256_final(&sha256, result2); + cl_sha256(U+32, 8, result2, NULL); dbg_printhex("Computed U", result2, 32); if (!memcmp(result2, U, 32)) { off_t n; password_empty = 1; /* Algorithm 3.2a could be used to recover encryption key */ - sha256_init(&sha256); - sha256_update(&sha256, U+40, 8); - sha256_final(&sha256, result2); + cl_sha256(U+40, 8, result2, NULL); n = UE ? strlen(UE) : 0; if (n != 32) { cli_dbgmsg("cli_pdf: UE length is not 32: %d\n", (int)n); @@ -1760,27 +1753,32 @@ static void check_user_password(struct pdf_struct *pdf, int R, const char *O, } } } else if ((R >= 2) && (R <= 4)) { + unsigned char *d; + size_t sz = 68 + pdf->fileIDlen + (R >= 4 && !EM ? 4 : 0); + d = calloc(1, sz); + + if (!(d)) + return; + + memcpy(d, key_padding, 32); + memcpy(d+32, O, 32); + P = le32_to_host(P); + memcpy(d+64, &P, 4); + memcpy(d+68, pdf->fileID, pdf->fileIDlen); /* 7.6.3.3 Algorithm 2 */ - cli_md5_init(&md5); /* empty password, password == padding */ - cli_md5_update(&md5, key_padding, 32); - cli_md5_update(&md5, O, 32); - P = le32_to_host(P); - cli_md5_update(&md5, &P, 4); - cli_md5_update(&md5, pdf->fileID, pdf->fileIDlen); if (R >= 4 && !EM) { uint32_t v = 0xFFFFFFFF; - cli_md5_update(&md5, &v, 4); + memcpy(d+68+pdf->fileIDlen, &v, 4); } - cli_md5_final(result, &md5); + cl_hash_data("md5", d, sz, result, NULL); + free(d); if (length > 128) length = 128; if (R >= 3) { - for (i=0;i<50;i++) { - cli_md5_init(&md5); - cli_md5_update(&md5, result, length/8); - cli_md5_final(result, &md5); - } + /* Yes, this really is on purpose */ + for (i=0;i<50;i++) + cl_hash_data("md5", result, length/8, result, NULL); } if (R == 2) length = 40; @@ -1803,11 +1801,16 @@ static void check_user_password(struct pdf_struct *pdf, int R, const char *O, password_empty = 1; } else if (R >= 3) { unsigned len = pdf->keylen; + unsigned char *d; + + d = calloc(1, 32 + pdf->fileIDlen); + if (!(d)) + return; + /* 7.6.3.3 Algorithm 5 */ - cli_md5_init(&md5); - cli_md5_update(&md5, key_padding, 32); - cli_md5_update(&md5, pdf->fileID, pdf->fileIDlen); - cli_md5_final(result, &md5); + memcpy(d, key_padding, 32); + memcpy(d+32, pdf->fileID, pdf->fileIDlen); + cl_hash_data("md5", d, 32 + pdf->fileIDlen, result, NULL); memcpy(data, pdf->key, len); arc4_init(&arc4, data, len); arc4_apply(&arc4, result, 16); diff --git a/libclamav/pe.c b/libclamav/pe.c index cb251748e..ddf2c248c 100644 --- a/libclamav/pe.c +++ b/libclamav/pe.c @@ -35,6 +35,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "clamav.h" #include "others.h" @@ -50,7 +54,6 @@ #include "scanners.h" #include "str.h" #include "execs.h" -#include "md5.h" #include "mew.h" #include "upack.h" #include "matcher.h" @@ -59,8 +62,6 @@ #include "special.h" #include "ishield.h" #include "asn1.h" -#include "sha1.h" -#include "libclamav/md5.h" #define DCONF ctx->dconf->pe @@ -487,9 +488,6 @@ static void cli_parseres_special(uint32_t base, uint32_t rva, fmap_t *map, struc static unsigned int cli_hashsect(fmap_t *map, struct cli_exe_section *s, unsigned char **digest, int * foundhash, int * foundwild) { const void *hashme; - cli_md5_ctx md5; - SHA1Context sha1ctx; - SHA256_CTX sha256ctx; if (s->rsz > CLI_MAX_ALLOCATION) { cli_dbgmsg("cli_hashsect: skipping hash calculation for too big section\n"); @@ -502,21 +500,12 @@ static unsigned int cli_hashsect(fmap_t *map, struct cli_exe_section *s, unsigne return 0; } - if(foundhash[CLI_HASH_MD5] || foundwild[CLI_HASH_MD5]) { - cli_md5_init(&md5); - cli_md5_update(&md5, hashme, s->rsz); - cli_md5_final(digest[CLI_HASH_MD5], &md5); - } - if(foundhash[CLI_HASH_SHA1] || foundwild[CLI_HASH_SHA1]) { - SHA1Init(&sha1ctx); - SHA1Update(&sha1ctx, hashme, s->rsz); - SHA1Final(&sha1ctx, digest[CLI_HASH_SHA1]); - } - if(foundhash[CLI_HASH_SHA256] || foundwild[CLI_HASH_SHA256]) { - sha256_init(&sha256ctx); - sha256_update(&sha256ctx, hashme, s->rsz); - sha256_final(&sha256ctx, digest[CLI_HASH_SHA256]); - } + if(foundhash[CLI_HASH_MD5] || foundwild[CLI_HASH_MD5]) + cl_hash_data("md5", hashme, s->rsz, digest[CLI_HASH_MD5], NULL); + if(foundhash[CLI_HASH_SHA1] || foundwild[CLI_HASH_SHA1]) + cl_sha1(hashme, s->rsz, digest[CLI_HASH_SHA1], NULL); + if(foundhash[CLI_HASH_SHA256] || foundwild[CLI_HASH_SHA256]) + cl_sha256(hashme, s->rsz, digest[CLI_HASH_SHA256], NULL); return 1; } @@ -563,7 +552,6 @@ static int scan_pe_mdb (cli_ctx * ctx, struct cli_exe_section *exe_section) md5[8], md5[9], md5[10], md5[11], md5[12], md5[13], md5[14], md5[15]); } else if (cli_always_gen_section_hash) { const void *hashme = fmap_need_off_once(*ctx->fmap, exe_section->raw, exe_section->rsz); - cli_md5_ctx md5ctx; if (!(hashme)) { cli_errmsg("scan_pe_mdb: unable to read section data\n"); ret = CL_EREAD; @@ -577,9 +565,7 @@ static int scan_pe_mdb (cli_ctx * ctx, struct cli_exe_section *exe_section) goto end; } - cli_md5_init(&md5ctx); - cli_md5_update(&md5ctx, hashme, exe_section->rsz); - cli_md5_final(md5, &md5ctx); + cl_hash_data("md5", hashme, exe_section->rsz, md5, NULL); cli_dbgmsg("MDB: %u:%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n", exe_section->rsz, md5[0], md5[1], md5[2], md5[3], md5[4], md5[5], md5[6], md5[7], @@ -2814,8 +2800,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin struct cli_exe_section *exe_sections; struct pe_image_data_dir *dirs; fmap_t *map = *ctx->fmap; - SHA1Context sha1; - cli_md5_ctx md5ctx; + EVP_MD_CTX *hashctx; if (flags & CL_CHECKFP_PE_FLAG_STATS) if (!(hashes)) @@ -2954,7 +2939,13 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin } } - SHA1Init(&sha1); + hashctx = EVP_MD_CTX_create(); + if (!(hashctx)) { + free(exe_sections); + return CL_EMEM; + } + + EVP_DigestInit(hashctx, EVP_sha1()); } #define hash_chunk(where, size, isStatAble, section) \ @@ -2966,12 +2957,16 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin return CL_EFORMAT; \ } \ if (flags & CL_CHECKFP_PE_FLAG_AUTHENTICODE) \ - SHA1Update(&sha1, hptr, size); \ + EVP_DigestUpdate(hashctx, hptr, size); \ if (isStatAble && flags & CL_CHECKFP_PE_FLAG_STATS) { \ - cli_md5_init(&md5ctx); \ - cli_md5_update(&md5ctx, hptr, size); \ - cli_md5_final(hashes->sections[section].md5, &md5ctx); \ - hashes->sections[section].len = size; \ + EVP_MD_CTX *md5ctx; \ + md5ctx = EVP_MD_CTX_create(); \ + if ((md5ctx)) { \ + EVP_DigestInit(md5ctx, EVP_md5()); \ + EVP_DigestUpdate(md5ctx, hptr, size); \ + EVP_DigestFinal(md5ctx, hashes->sections[section].md5, NULL); \ + EVP_MD_CTX_destroy(md5ctx); \ + } \ } \ } while(0) @@ -3023,9 +3018,11 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin hlen = fsize - at; if(dirs[4].Size > hlen) { if (flags & CL_CHECKFP_PE_FLAG_STATS) { + EVP_MD_CTX_destroy(hashctx); flags ^= CL_CHECKFP_PE_FLAG_AUTHENTICODE; break; } else { + EVP_MD_CTX_destroy(hashctx); free(exe_sections); return CL_EFORMAT; } @@ -3042,7 +3039,8 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin free(exe_sections); if (flags & CL_CHECKFP_PE_FLAG_AUTHENTICODE) { - SHA1Final(&sha1, authsha1); + EVP_DigestFinal(hashctx, authsha1, NULL); + EVP_MD_CTX_destroy(hashctx); if(cli_debug_flag) { char shatxt[SHA1_HASH_SIZE*2+1]; diff --git a/libclamav/pe_icons.c b/libclamav/pe_icons.c index cbe4ee03c..902dbe777 100644 --- a/libclamav/pe_icons.c +++ b/libclamav/pe_icons.c @@ -25,6 +25,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "pe_icons.h" #include "others.h" diff --git a/libclamav/petite.c b/libclamav/petite.c index 2f243340a..1756a2866 100644 --- a/libclamav/petite.c +++ b/libclamav/petite.c @@ -52,6 +52,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "rebuildpe.h" #include "execs.h" diff --git a/libclamav/phish_domaincheck_db.c b/libclamav/phish_domaincheck_db.c index 4f9f132eb..9e10a74eb 100644 --- a/libclamav/phish_domaincheck_db.c +++ b/libclamav/phish_domaincheck_db.c @@ -34,6 +34,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "phishcheck.h" diff --git a/libclamav/phish_whitelist.c b/libclamav/phish_whitelist.c index 8718653d0..15aa0a7bf 100644 --- a/libclamav/phish_whitelist.c +++ b/libclamav/phish_whitelist.c @@ -34,6 +34,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "phish_whitelist.h" diff --git a/libclamav/phishcheck.c b/libclamav/phishcheck.c index 98a638cde..d940434e3 100644 --- a/libclamav/phishcheck.c +++ b/libclamav/phishcheck.c @@ -34,6 +34,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "cltypes.h" #include "others.h" @@ -45,7 +49,6 @@ #include "iana_tld.h" #include "iana_cctld.h" #include "scanners.h" -#include "sha256.h" #include #include "mpool.h" @@ -1199,12 +1202,18 @@ static int hash_match(const struct regex_matcher *rlist, const char *host, size_ unsigned char h[65]; unsigned char sha256_dig[32]; unsigned i; - SHA256_CTX sha256; + EVP_MD_CTX *sha256; + + sha256 = EVP_MD_CTX_create(); + if (!(sha256)) + return CL_SUCCESS; + + EVP_DigestInit(sha256, EVP_sha256()); + EVP_DigestUpdate(sha256, host, hlen); + EVP_DigestUpdate(sha256, path, plen); + EVP_DigestFinal(sha256, sha256_dig, NULL); - sha256_init(&sha256); - sha256_update(&sha256, host, hlen); - sha256_update(&sha256, path, plen); - sha256_final(&sha256, sha256_dig); + EVP_MD_CTX_destroy(sha256); for(i=0;i<32;i++) { h[2*i] = hexchars[sha256_dig[i]>>4]; h[2*i+1] = hexchars[sha256_dig[i]&0xf]; diff --git a/libclamav/png.c b/libclamav/png.c index ed5940f74..58b8d2704 100644 --- a/libclamav/png.c +++ b/libclamav/png.c @@ -33,6 +33,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "png.h" diff --git a/libclamav/qsort.c b/libclamav/qsort.c index 018e93b58..0a71d3d61 100644 --- a/libclamav/qsort.c +++ b/libclamav/qsort.c @@ -32,6 +32,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "platform.h" #include "cltypes.h" #include "others.h" diff --git a/libclamav/readdb.c b/libclamav/readdb.c index de8de1fe9..00f2902d5 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -39,6 +39,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "cvd.h" #ifdef HAVE_STRINGS_H @@ -56,8 +60,6 @@ #include "readdb.h" #include "cltypes.h" #include "default.h" -#include "md5.h" -#include "sha256.h" #include "dsig.h" #include "asn1.h" @@ -418,7 +420,8 @@ char *cli_dbgets(char *buff, unsigned int size, FILE *fs, struct cli_dbio *dbio) dbio->bufpt = dbio->buf; dbio->size -= bread; dbio->bread += bread; - sha256_update(&dbio->sha256ctx, dbio->readpt, bread); + if ((dbio->hashctx)) + EVP_DigestUpdate(dbio->hashctx, dbio->readpt, bread); } if(dbio->chkonly && dbio->bufpt) { dbio->bufpt = NULL; @@ -475,30 +478,29 @@ char *cli_dbgets(char *buff, unsigned int size, FILE *fs, struct cli_dbio *dbio) bs = strlen(buff); dbio->size -= bs; dbio->bread += bs; - sha256_update(&dbio->sha256ctx, buff, bs); + if ((dbio->hashctx)) + EVP_DigestUpdate(dbio->hashctx, buff, bs); return pt; } } static int cli_chkign(const struct cli_matcher *ignored, const char *signame, const char *entry) { - const char *md5_expected = NULL; - cli_md5_ctx md5ctx; - unsigned char digest[16]; + const char *md5_expected = NULL; + unsigned char digest[16]; if(!ignored || !signame || !entry) - return 0; + return 0; if(cli_bm_scanbuff((const unsigned char *) signame, strlen(signame), &md5_expected, NULL, ignored, 0, NULL, NULL,NULL) == CL_VIRUS) { - if(md5_expected) { - cli_md5_init(&md5ctx); - cli_md5_update(&md5ctx, entry, strlen(entry)); - cli_md5_final(digest, &md5ctx); - if(memcmp(digest, (const unsigned char *) md5_expected, 16)) - return 0; - } - cli_dbgmsg("Ignoring signature %s\n", signame); - return 1; + if(md5_expected) { + cl_hash_data("md5", entry, strlen(entry), digest, NULL); + if(memcmp(digest, (const unsigned char *) md5_expected, 16)) + return 0; + } + + cli_dbgmsg("Ignoring signature %s\n", signame); + return 1; } return 0; @@ -1724,19 +1726,26 @@ static int cli_loadinfo(FILE *fs, struct cl_engine *engine, unsigned int options unsigned char hash[32]; struct cli_dbinfo *last = NULL, *new; int ret = CL_SUCCESS, dsig = 0; - SHA256_CTX ctx; + EVP_MD_CTX *ctx; if(!dbio) { cli_errmsg("cli_loadinfo: .info files can only be loaded from within database container files\n"); return CL_EMALFDB; } - sha256_init(&ctx); + + ctx = EVP_MD_CTX_create(); + if (!(ctx)) + return CL_EMALFDB; + + EVP_DigestInit(ctx, EVP_sha256()); + while(cli_dbgets(buffer, FILEBUFF, fs, dbio)) { line++; if(!(options & CL_DB_UNSIGNED) && !strncmp(buffer, "DSIG:", 5)) { dsig = 1; - sha256_final(&ctx, hash); + EVP_DigestFinal(ctx, hash, NULL); + EVP_MD_CTX_destroy(ctx); if(cli_versig2(hash, buffer + 5, INFO_NSTR, INFO_ESTR) != CL_SUCCESS) { cli_errmsg("cli_loadinfo: Incorrect digital signature\n"); ret = CL_EMALFDB; @@ -1754,7 +1763,7 @@ static int cli_loadinfo(FILE *fs, struct cl_engine *engine, unsigned int options buffer[len + 1] = 0; } } - sha256_update(&ctx, buffer, strlen(buffer)); + EVP_DigestUpdate(ctx, buffer, strlen(buffer)); cli_chomp(buffer); if(!strncmp("ClamAV-VDB:", buffer, 11)) { if(engine->dbinfo) { /* shouldn't be initialized at this point */ diff --git a/libclamav/rebuildpe.c b/libclamav/rebuildpe.c index 2dfa4c18b..570b082c9 100644 --- a/libclamav/rebuildpe.c +++ b/libclamav/rebuildpe.c @@ -40,6 +40,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "rebuildpe.h" #include "others.h" diff --git a/libclamav/regex/regcomp.c b/libclamav/regex/regcomp.c index ab6ae7fa4..fefb44381 100644 --- a/libclamav/regex/regcomp.c +++ b/libclamav/regex/regcomp.c @@ -41,6 +41,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "regex.h" diff --git a/libclamav/regex/regerror.c b/libclamav/regex/regerror.c index 9c0b02b03..a478213eb 100644 --- a/libclamav/regex/regerror.c +++ b/libclamav/regex/regerror.c @@ -41,6 +41,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "regex.h" diff --git a/libclamav/regex/regexec.c b/libclamav/regex/regexec.c index 8dec1d2d7..d9151e4f9 100644 --- a/libclamav/regex/regexec.c +++ b/libclamav/regex/regexec.c @@ -48,6 +48,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "regex.h" diff --git a/libclamav/regex/regfree.c b/libclamav/regex/regfree.c index 0568ce3f6..bf9f68be4 100644 --- a/libclamav/regex/regfree.c +++ b/libclamav/regex/regfree.c @@ -38,6 +38,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "regex.h" diff --git a/libclamav/regex_list.c b/libclamav/regex_list.c index 8902fa544..d9b637ae6 100644 --- a/libclamav/regex_list.c +++ b/libclamav/regex_list.c @@ -40,10 +40,12 @@ #include #include +#include +#include +#include "libclamav/crypto.h" #include "regex/regex.h" - #include "clamav.h" #include "others.h" #include "regex_list.h" diff --git a/libclamav/regex_suffix.c b/libclamav/regex_suffix.c index d7853ee03..73863b849 100644 --- a/libclamav/regex_suffix.c +++ b/libclamav/regex_suffix.c @@ -28,6 +28,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "jsparse/textbuf.h" #include "regex_suffix.h" diff --git a/libclamav/rtf.c b/libclamav/rtf.c index c9442f849..22282f2a0 100644 --- a/libclamav/rtf.c +++ b/libclamav/rtf.c @@ -33,6 +33,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "rtf.h" #include "clamav.h" diff --git a/libclamav/scanners.c b/libclamav/scanners.c index d185a1e87..cd877e987 100644 --- a/libclamav/scanners.c +++ b/libclamav/scanners.c @@ -43,6 +43,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #define DCONF_ARCH ctx->dconf->archive #define DCONF_DOC ctx->dconf->doc #define DCONF_MAIL ctx->dconf->mail @@ -109,6 +113,8 @@ #include #endif +#include + static int cli_scanfile(const char *filename, cli_ctx *ctx); static int cli_scandir(const char *dirname, cli_ctx *ctx) diff --git a/libclamav/sha1.c b/libclamav/sha1.c deleted file mode 100644 index 4005de890..000000000 --- a/libclamav/sha1.c +++ /dev/null @@ -1,626 +0,0 @@ -/*- - * Copyright (c) 2001-2003 Allan Saddi - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY ALLAN SADDI AND HIS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL ALLAN SADDI OR HIS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $Id: sha1.c 680 2003-07-25 21:57:38Z asaddi $ - */ - -/* - * Define WORDS_BIGENDIAN if compiling on a big-endian architecture. - * - * Define SHA1_TEST to test the implementation using the NIST's - * sample messages. The output should be: - * - * a9993e36 4706816a ba3e2571 7850c26c 9cd0d89d - * 84983e44 1c3bd26e baae4aa1 f95129e5 e54670f1 - * 34aa973c d4c4daa4 f61eeb2b dbad2731 6534016f - */ - -#ifdef HAVE_CONFIG_H -#include "clamav-config.h" -#endif /* HAVE_CONFIG_H */ - -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif - -#include - -#include "sha1.h" - -#ifndef lint -static const char rcsid[] = - "$Id: sha1.c 680 2003-07-25 21:57:38Z asaddi $"; -#endif /* !lint */ - -#define ROTL(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) -#define ROTR(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) - -#define F_0_19(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define F_20_39(x, y, z) ((x) ^ (y) ^ (z)) -#define F_40_59(x, y, z) (((x) & ((y) | (z))) | ((y) & (z))) -#define F_60_79(x, y, z) ((x) ^ (y) ^ (z)) - -#define DO_ROUND(F, K) { \ - temp = ROTL(a, 5) + F(b, c, d) + e + *(W++) + K; \ - e = d; \ - d = c; \ - c = ROTL(b, 30); \ - b = a; \ - a = temp; \ -} - -#define K_0_19 0x5a827999L -#define K_20_39 0x6ed9eba1L -#define K_40_59 0x8f1bbcdcL -#define K_60_79 0xca62c1d6L - -#ifndef RUNTIME_ENDIAN - -#if WORDS_BIGENDIAN == 1 - -#define BYTESWAP(x) (x) -#define BYTESWAP64(x) (x) - -#else /* WORDS_BIGENDIAN */ - -#define BYTESWAP(x) ((ROTR((x), 8) & 0xff00ff00L) | \ - (ROTL((x), 8) & 0x00ff00ffL)) -#define BYTESWAP64(x) _byteswap64(x) - -static inline uint64_t _byteswap64(uint64_t x) -{ - uint32_t a = x >> 32; - uint32_t b = (uint32_t) x; - return ((uint64_t) BYTESWAP(b) << 32) | (uint64_t) BYTESWAP(a); -} - -#endif /* WORDS_BIGENDIAN */ - -#else /* !RUNTIME_ENDIAN */ - -#define BYTESWAP(x) _byteswap(sc->littleEndian, x) -#define BYTESWAP64(x) _byteswap64(sc->littleEndian, x) - -#define _BYTESWAP(x) ((ROTR((x), 8) & 0xff00ff00L) | \ - (ROTL((x), 8) & 0x00ff00ffL)) -#define _BYTESWAP64(x) __byteswap64(x) - -static inline uint64_t __byteswap64(uint64_t x) -{ - uint32_t a = x >> 32; - uint32_t b = (uint32_t) x; - return ((uint64_t) _BYTESWAP(b) << 32) | (uint64_t) _BYTESWAP(a); -} - -static inline uint32_t _byteswap(int littleEndian, uint32_t x) -{ - if (!littleEndian) - return x; - else - return _BYTESWAP(x); -} - -static inline uint64_t _byteswap64(int littleEndian, uint64_t x) -{ - if (!littleEndian) - return x; - else - return _BYTESWAP64(x); -} - -static inline void setEndian(int *littleEndianp) -{ - union { - uint32_t w; - uint8_t b[4]; - } endian; - - endian.w = 1L; - *littleEndianp = endian.b[0] != 0; -} - -#endif /* !RUNTIME_ENDIAN */ - -static const uint8_t padding[64] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -void -SHA1Init (SHA1Context *sc) -{ -#ifdef RUNTIME_ENDIAN - setEndian (&sc->littleEndian); -#endif /* RUNTIME_ENDIAN */ - - sc->totalLength = 0LL; - sc->hash[0] = 0x67452301L; - sc->hash[1] = 0xefcdab89L; - sc->hash[2] = 0x98badcfeL; - sc->hash[3] = 0x10325476L; - sc->hash[4] = 0xc3d2e1f0L; - sc->bufferLength = 0L; -} - -static void -burnStack (int size) -{ - char buf[128]; - - memset (buf, 0, sizeof (buf)); - size -= sizeof (buf); - if (size > 0) - burnStack (size); -} - -static void -SHA1Guts (SHA1Context *sc, const uint32_t *cbuf) -{ - uint32_t buf[80]; - uint32_t *W, *W3, *W8, *W14, *W16; - uint32_t a, b, c, d, e, temp; - int i; - - W = buf; - - for (i = 15; i >= 0; i--) { - *(W++) = BYTESWAP(*cbuf); - cbuf++; - } - - W16 = &buf[0]; - W14 = &buf[2]; - W8 = &buf[8]; - W3 = &buf[13]; - - for (i = 63; i >= 0; i--) { - *W = *(W3++) ^ *(W8++) ^ *(W14++) ^ *(W16++); - *W = ROTL(*W, 1); - W++; - } - - a = sc->hash[0]; - b = sc->hash[1]; - c = sc->hash[2]; - d = sc->hash[3]; - e = sc->hash[4]; - - W = buf; - -#ifndef SHA1_UNROLL -#define SHA1_UNROLL 20 -#endif /* !SHA1_UNROLL */ - -#if SHA1_UNROLL == 1 - for (i = 19; i >= 0; i--) - DO_ROUND(F_0_19, K_0_19); - - for (i = 19; i >= 0; i--) - DO_ROUND(F_20_39, K_20_39); - - for (i = 19; i >= 0; i--) - DO_ROUND(F_40_59, K_40_59); - - for (i = 19; i >= 0; i--) - DO_ROUND(F_60_79, K_60_79); -#elif SHA1_UNROLL == 2 - for (i = 9; i >= 0; i--) { - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - } - - for (i = 9; i >= 0; i--) { - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - } - - for (i = 9; i >= 0; i--) { - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - } - - for (i = 9; i >= 0; i--) { - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - } -#elif SHA1_UNROLL == 4 - for (i = 4; i >= 0; i--) { - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - } - - for (i = 4; i >= 0; i--) { - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - } - - for (i = 4; i >= 0; i--) { - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - } - - for (i = 4; i >= 0; i--) { - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - } -#elif SHA1_UNROLL == 5 - for (i = 3; i >= 0; i--) { - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - } - - for (i = 3; i >= 0; i--) { - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - } - - for (i = 3; i >= 0; i--) { - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - } - - for (i = 3; i >= 0; i--) { - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - } -#elif SHA1_UNROLL == 10 - for (i = 1; i >= 0; i--) { - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - } - - for (i = 1; i >= 0; i--) { - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - } - - for (i = 1; i >= 0; i--) { - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - } - - for (i = 1; i >= 0; i--) { - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - } -#elif SHA1_UNROLL == 20 - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - DO_ROUND(F_0_19, K_0_19); - - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - DO_ROUND(F_20_39, K_20_39); - - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - DO_ROUND(F_40_59, K_40_59); - - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); - DO_ROUND(F_60_79, K_60_79); -#else /* SHA1_UNROLL */ -#error SHA1_UNROLL must be 1, 2, 4, 5, 10 or 20! -#endif - - sc->hash[0] += a; - sc->hash[1] += b; - sc->hash[2] += c; - sc->hash[3] += d; - sc->hash[4] += e; -} - -void -SHA1Update (SHA1Context *sc, const void *vdata, uint32_t len) -{ - const uint8_t *data = vdata; - uint32_t bufferBytesLeft; - uint32_t bytesToCopy; - int needBurn = 0; - -#ifdef SHA1_FAST_COPY - if (sc->bufferLength) { - bufferBytesLeft = 64L - sc->bufferLength; - - bytesToCopy = bufferBytesLeft; - if (bytesToCopy > len) - bytesToCopy = len; - - memcpy (&sc->buffer.bytes[sc->bufferLength], data, bytesToCopy); - - sc->totalLength += bytesToCopy * 8L; - - sc->bufferLength += bytesToCopy; - data += bytesToCopy; - len -= bytesToCopy; - - if (sc->bufferLength == 64L) { - SHA1Guts (sc, sc->buffer.words); - needBurn = 1; - sc->bufferLength = 0L; - } - } - - while (len > 63) { - sc->totalLength += 512L; - - SHA1Guts (sc, data); - needBurn = 1; - - data += 64L; - len -= 64L; - } - - if (len) { - memcpy (&sc->buffer.bytes[sc->bufferLength], data, len); - - sc->totalLength += len * 8L; - - sc->bufferLength += len; - } -#else /* SHA1_FAST_COPY */ - while (len) { - bufferBytesLeft = 64L - sc->bufferLength; - - bytesToCopy = bufferBytesLeft; - if (bytesToCopy > len) - bytesToCopy = len; - - memcpy (&sc->buffer.bytes[sc->bufferLength], data, bytesToCopy); - - sc->totalLength += bytesToCopy * 8L; - - sc->bufferLength += bytesToCopy; - data += bytesToCopy; - len -= bytesToCopy; - - if (sc->bufferLength == 64L) { - SHA1Guts (sc, sc->buffer.words); - needBurn = 1; - sc->bufferLength = 0L; - } - } -#endif /* SHA1_FAST_COPY */ - - if (needBurn) - burnStack (sizeof (uint32_t[86]) + sizeof (uint32_t *[5]) + sizeof (int)); -} - -void -SHA1Final (SHA1Context *sc, uint8_t hash[SHA1_HASH_SIZE]) -{ - uint32_t bytesToPad; - uint64_t lengthPad; - int i; - - bytesToPad = 120L - sc->bufferLength; - if (bytesToPad > 64L) - bytesToPad -= 64L; - - lengthPad = BYTESWAP64(sc->totalLength); - - SHA1Update (sc, padding, bytesToPad); - SHA1Update (sc, &lengthPad, 8L); - - if (hash) { - for (i = 0; i < SHA1_HASH_WORDS; i++) { -#ifdef SHA1_FAST_COPY - *((uint32_t *) hash) = BYTESWAP(sc->hash[i]); -#else /* SHA1_FAST_COPY */ - hash[0] = (uint8_t) (sc->hash[i] >> 24); - hash[1] = (uint8_t) (sc->hash[i] >> 16); - hash[2] = (uint8_t) (sc->hash[i] >> 8); - hash[3] = (uint8_t) sc->hash[i]; -#endif /* SHA1_FAST_COPY */ - hash += 4; - } - } -} - -#ifdef SHA1_TEST - -#include -#include -#include - -int -main (int argc, char *argv[]) -{ - SHA1Context foo; - uint8_t hash[SHA1_HASH_SIZE]; - char buf[1000]; - int i; - - SHA1Init (&foo); - SHA1Update (&foo, "abc", 3); - SHA1Final (&foo, hash); - - for (i = 0; i < SHA1_HASH_SIZE;) { - printf ("%02x", hash[i++]); - if (!(i % 4)) - printf (" "); - } - printf ("\n"); - - SHA1Init (&foo); - SHA1Update (&foo, - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", - 56); - SHA1Final (&foo, hash); - - for (i = 0; i < SHA1_HASH_SIZE;) { - printf ("%02x", hash[i++]); - if (!(i % 4)) - printf (" "); - } - printf ("\n"); - - SHA1Init (&foo); - memset (buf, 'a', sizeof (buf)); - for (i = 0; i < 1000; i++) - SHA1Update (&foo, buf, sizeof (buf)); - SHA1Final (&foo, hash); - - for (i = 0; i < SHA1_HASH_SIZE;) { - printf ("%02x", hash[i++]); - if (!(i % 4)) - printf (" "); - } - printf ("\n"); - - exit (0); -} - -#endif /* SHA1_TEST */ diff --git a/libclamav/sha1.h b/libclamav/sha1.h deleted file mode 100644 index 8ccb79c06..000000000 --- a/libclamav/sha1.h +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * Copyright (c) 2001-2003 Allan Saddi - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY ALLAN SADDI AND HIS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL ALLAN SADDI OR HIS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $Id: sha1.h 347 2003-02-23 22:11:49Z asaddi $ - */ - -#ifndef _SHA1_H -#define _SHA1_H - -#include "cltypes.h" - -#define SHA1_HASH_SIZE 20 - -/* Hash size in 32-bit words */ -#define SHA1_HASH_WORDS 5 - -struct _SHA1Context { - uint64_t totalLength; - uint32_t hash[SHA1_HASH_WORDS]; - uint32_t bufferLength; - union { - uint32_t words[16]; - uint8_t bytes[64]; - } buffer; -#ifdef RUNTIME_ENDIAN - int littleEndian; -#endif /* RUNTIME_ENDIAN */ -}; - -typedef struct _SHA1Context SHA1Context; - -#ifdef __cplusplus -extern "C" { -#endif - -void SHA1Init (SHA1Context *sc); -void SHA1Update (SHA1Context *sc, const void *data, uint32_t len); -void SHA1Final (SHA1Context *sc, uint8_t hash[SHA1_HASH_SIZE]); - -#ifdef __cplusplus -} -#endif - -#endif /* _SHA1_H */ diff --git a/libclamav/sha256.c b/libclamav/sha256.c deleted file mode 100644 index 21a46200f..000000000 --- a/libclamav/sha256.c +++ /dev/null @@ -1,480 +0,0 @@ -/*- - * Copyright (c) 2001-2003 Allan Saddi - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY ALLAN SADDI AND HIS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL ALLAN SADDI OR HIS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $Id: sha256.c 680 2003-07-25 21:57:49Z asaddi $ - */ - -/* - * Define WORDS_BIGENDIAN if compiling on a big-endian architecture. - * - * Define SHA256_TEST to test the implementation using the NIST's - * sample messages. The output should be: - * - * ba7816bf 8f01cfea 414140de 5dae2223 b00361a3 96177a9c b410ff61 f20015ad - * 248d6a61 d20638b8 e5c02693 0c3e6039 a33ce459 64ff2167 f6ecedd4 19db06c1 - * cdc76e5c 9914fb92 81a1c7e2 84d73e67 f1809a48 a497200e 046d39cc c7112cd0 - */ - -#ifdef HAVE_CONFIG_H -#include "clamav-config.h" -#endif /* HAVE_CONFIG_H */ - -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif - -#include - -#include "sha256.h" - -#ifndef lint -static const char rcsid[] = - "$Id: sha256.c 680 2003-07-25 21:57:49Z asaddi $"; -#endif /* !lint */ - -#define ROTL(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) -#define ROTR(x, n) (((x) >> (n)) | ((x) << (32 - (n)))) - -#define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) -#define Maj(x, y, z) (((x) & ((y) | (z))) | ((y) & (z))) -#define SIGMA0(x) (ROTR((x), 2) ^ ROTR((x), 13) ^ ROTR((x), 22)) -#define SIGMA1(x) (ROTR((x), 6) ^ ROTR((x), 11) ^ ROTR((x), 25)) -#define sigma0(x) (ROTR((x), 7) ^ ROTR((x), 18) ^ ((x) >> 3)) -#define sigma1(x) (ROTR((x), 17) ^ ROTR((x), 19) ^ ((x) >> 10)) - -#define DO_ROUND() { \ - t1 = h + SIGMA1(e) + Ch(e, f, g) + *(Kp++) + *(W++); \ - t2 = SIGMA0(a) + Maj(a, b, c); \ - h = g; \ - g = f; \ - f = e; \ - e = d + t1; \ - d = c; \ - c = b; \ - b = a; \ - a = t1 + t2; \ -} - -static const uint32_t K[64] = { - 0x428a2f98L, 0x71374491L, 0xb5c0fbcfL, 0xe9b5dba5L, - 0x3956c25bL, 0x59f111f1L, 0x923f82a4L, 0xab1c5ed5L, - 0xd807aa98L, 0x12835b01L, 0x243185beL, 0x550c7dc3L, - 0x72be5d74L, 0x80deb1feL, 0x9bdc06a7L, 0xc19bf174L, - 0xe49b69c1L, 0xefbe4786L, 0x0fc19dc6L, 0x240ca1ccL, - 0x2de92c6fL, 0x4a7484aaL, 0x5cb0a9dcL, 0x76f988daL, - 0x983e5152L, 0xa831c66dL, 0xb00327c8L, 0xbf597fc7L, - 0xc6e00bf3L, 0xd5a79147L, 0x06ca6351L, 0x14292967L, - 0x27b70a85L, 0x2e1b2138L, 0x4d2c6dfcL, 0x53380d13L, - 0x650a7354L, 0x766a0abbL, 0x81c2c92eL, 0x92722c85L, - 0xa2bfe8a1L, 0xa81a664bL, 0xc24b8b70L, 0xc76c51a3L, - 0xd192e819L, 0xd6990624L, 0xf40e3585L, 0x106aa070L, - 0x19a4c116L, 0x1e376c08L, 0x2748774cL, 0x34b0bcb5L, - 0x391c0cb3L, 0x4ed8aa4aL, 0x5b9cca4fL, 0x682e6ff3L, - 0x748f82eeL, 0x78a5636fL, 0x84c87814L, 0x8cc70208L, - 0x90befffaL, 0xa4506cebL, 0xbef9a3f7L, 0xc67178f2L -}; - -#ifndef RUNTIME_ENDIAN - -#if WORDS_BIGENDIAN == 1 - -#define BYTESWAP(x) (x) -#define BYTESWAP64(x) (x) - -#else /* WORDS_BIGENDIAN */ - -#define BYTESWAP(x) ((ROTR((x), 8) & 0xff00ff00L) | \ - (ROTL((x), 8) & 0x00ff00ffL)) -#define BYTESWAP64(x) _byteswap64(x) - -static inline uint64_t _byteswap64(uint64_t x) -{ - uint32_t a = x >> 32; - uint32_t b = (uint32_t) x; - return ((uint64_t) BYTESWAP(b) << 32) | (uint64_t) BYTESWAP(a); -} - -#endif /* WORDS_BIGENDIAN */ - -#else /* !RUNTIME_ENDIAN */ - -#define BYTESWAP(x) _byteswap(sc->littleEndian, x) -#define BYTESWAP64(x) _byteswap64(sc->littleEndian, x) - -#define _BYTESWAP(x) ((ROTR((x), 8) & 0xff00ff00L) | \ - (ROTL((x), 8) & 0x00ff00ffL)) -#define _BYTESWAP64(x) __byteswap64(x) - -static inline uint64_t __byteswap64(uint64_t x) -{ - uint32_t a = x >> 32; - uint32_t b = (uint32_t) x; - return ((uint64_t) _BYTESWAP(b) << 32) | (uint64_t) _BYTESWAP(a); -} - -static inline uint32_t _byteswap(int littleEndian, uint32_t x) -{ - if (!littleEndian) - return x; - else - return _BYTESWAP(x); -} - -static inline uint64_t _byteswap64(int littleEndian, uint64_t x) -{ - if (!littleEndian) - return x; - else - return _BYTESWAP64(x); -} - -static inline void setEndian(int *littleEndianp) -{ - union { - uint32_t w; - uint8_t b[4]; - } endian; - - endian.w = 1L; - *littleEndianp = endian.b[0] != 0; -} - -#endif /* !RUNTIME_ENDIAN */ - -static const uint8_t padding[64] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -void -sha256_init (SHA256_CTX *sc) -{ -#ifdef RUNTIME_ENDIAN - setEndian (&sc->littleEndian); -#endif /* RUNTIME_ENDIAN */ - - sc->totalLength = 0LL; - sc->hash[0] = 0x6a09e667L; - sc->hash[1] = 0xbb67ae85L; - sc->hash[2] = 0x3c6ef372L; - sc->hash[3] = 0xa54ff53aL; - sc->hash[4] = 0x510e527fL; - sc->hash[5] = 0x9b05688cL; - sc->hash[6] = 0x1f83d9abL; - sc->hash[7] = 0x5be0cd19L; - sc->bufferLength = 0L; -} - -static void -burnStack (int size) -{ - char buf[128]; - - memset (buf, 0, sizeof (buf)); - size -= sizeof (buf); - if (size > 0) - burnStack (size); -} - -static void -SHA256Guts (SHA256_CTX *sc, const uint32_t *cbuf) -{ - uint32_t buf[64]; - uint32_t *W, *W2, *W7, *W15, *W16; - uint32_t a, b, c, d, e, f, g, h; - uint32_t t1, t2; - const uint32_t *Kp; - int i; - - W = buf; - - for (i = 15; i >= 0; i--) { - *(W++) = BYTESWAP(*cbuf); - cbuf++; - } - - W16 = &buf[0]; - W15 = &buf[1]; - W7 = &buf[9]; - W2 = &buf[14]; - - for (i = 47; i >= 0; i--) { - *(W++) = sigma1(*W2) + *(W7++) + sigma0(*W15) + *(W16++); - W2++; - W15++; - } - - a = sc->hash[0]; - b = sc->hash[1]; - c = sc->hash[2]; - d = sc->hash[3]; - e = sc->hash[4]; - f = sc->hash[5]; - g = sc->hash[6]; - h = sc->hash[7]; - - Kp = K; - W = buf; - -#ifndef SHA256_UNROLL -#define SHA256_UNROLL 4 -#endif /* !SHA256_UNROLL */ - -#if SHA256_UNROLL == 1 - for (i = 63; i >= 0; i--) - DO_ROUND(); -#elif SHA256_UNROLL == 2 - for (i = 31; i >= 0; i--) { - DO_ROUND(); DO_ROUND(); - } -#elif SHA256_UNROLL == 4 - for (i = 15; i >= 0; i--) { - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - } -#elif SHA256_UNROLL == 8 - for (i = 7; i >= 0; i--) { - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - } -#elif SHA256_UNROLL == 16 - for (i = 3; i >= 0; i--) { - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - } -#elif SHA256_UNROLL == 32 - for (i = 1; i >= 0; i--) { - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - } -#elif SHA256_UNROLL == 64 - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); - DO_ROUND(); DO_ROUND(); DO_ROUND(); DO_ROUND(); -#else -#error "SHA256_UNROLL must be 1, 2, 4, 8, 16, 32, or 64!" -#endif - - sc->hash[0] += a; - sc->hash[1] += b; - sc->hash[2] += c; - sc->hash[3] += d; - sc->hash[4] += e; - sc->hash[5] += f; - sc->hash[6] += g; - sc->hash[7] += h; -} - -void -sha256_update (SHA256_CTX *sc, const void *vdata, uint32_t len) -{ - const uint8_t *data = vdata; - uint32_t bufferBytesLeft; - uint32_t bytesToCopy; - int needBurn = 0; -#ifdef SHA256_FAST_COPY - if (sc->bufferLength) { - bufferBytesLeft = 64L - sc->bufferLength; - - bytesToCopy = bufferBytesLeft; - if (bytesToCopy > len) - bytesToCopy = len; - - memcpy (&sc->buffer.bytes[sc->bufferLength], data, bytesToCopy); - - sc->totalLength += bytesToCopy * 8L; - - sc->bufferLength += bytesToCopy; - data += bytesToCopy; - len -= bytesToCopy; - - if (sc->bufferLength == 64L) { - SHA256Guts (sc, sc->buffer.words); - needBurn = 1; - sc->bufferLength = 0L; - } - } - - while (len > 63L) { - sc->totalLength += 512L; - - SHA256Guts (sc, data); - needBurn = 1; - - data += 64L; - len -= 64L; - } - - if (len) { - memcpy (&sc->buffer.bytes[sc->bufferLength], data, len); - - sc->totalLength += len * 8L; - - sc->bufferLength += len; - } -#else /* SHA256_FAST_COPY */ - while (len) { - bufferBytesLeft = 64L - sc->bufferLength; - - bytesToCopy = bufferBytesLeft; - if (bytesToCopy > len) - bytesToCopy = len; - - memcpy (&sc->buffer.bytes[sc->bufferLength], data, bytesToCopy); - - sc->totalLength += bytesToCopy * 8L; - - sc->bufferLength += bytesToCopy; - data += bytesToCopy; - len -= bytesToCopy; - - if (sc->bufferLength == 64L) { - SHA256Guts (sc, sc->buffer.words); - needBurn = 1; - sc->bufferLength = 0L; - } - } -#endif /* SHA256_FAST_COPY */ - - if (needBurn) - burnStack (sizeof (uint32_t[74]) + sizeof (uint32_t *[6]) + sizeof (int)); -} - -void -sha256_final (SHA256_CTX *sc, uint8_t hash[SHA256_HASH_SIZE]) -{ - uint32_t bytesToPad; - uint64_t lengthPad; - int i; - - bytesToPad = 120L - sc->bufferLength; - if (bytesToPad > 64L) - bytesToPad -= 64L; - - lengthPad = BYTESWAP64(sc->totalLength); - - sha256_update (sc, padding, bytesToPad); - sha256_update (sc, &lengthPad, 8L); - - if (hash) { - for (i = 0; i < SHA256_HASH_WORDS; i++) { -#ifdef SHA256_FAST_COPY - *((uint32_t *) hash) = BYTESWAP(sc->hash[i]); -#else /* SHA256_FAST_COPY */ - hash[0] = (uint8_t) (sc->hash[i] >> 24); - hash[1] = (uint8_t) (sc->hash[i] >> 16); - hash[2] = (uint8_t) (sc->hash[i] >> 8); - hash[3] = (uint8_t) sc->hash[i]; -#endif /* SHA256_FAST_COPY */ - hash += 4; - } - } -} - -#ifdef SHA256_TEST - -#include -#include -#include - -int -main (int argc, char *argv[]) -{ - SHA256_CTX foo; - uint8_t hash[SHA256_HASH_SIZE]; - char buf[1000]; - int i; - - sha256_init (&foo); - sha256_update (&foo, "abc", 3); - sha256_final (&foo, hash); - - for (i = 0; i < SHA256_HASH_SIZE;) { - printf ("%02x", hash[i++]); - if (!(i % 4)) - printf (" "); - } - printf ("\n"); - - sha256_init (&foo); - sha256_update (&foo, - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", - 56); - sha256_final (&foo, hash); - - for (i = 0; i < SHA256_HASH_SIZE;) { - printf ("%02x", hash[i++]); - if (!(i % 4)) - printf (" "); - } - printf ("\n"); - - sha256_init (&foo); - memset (buf, 'a', sizeof (buf)); - for (i = 0; i < 1000; i++) - sha256_update (&foo, buf, sizeof (buf)); - sha256_final (&foo, hash); - - for (i = 0; i < SHA256_HASH_SIZE;) { - printf ("%02x", hash[i++]); - if (!(i % 4)) - printf (" "); - } - printf ("\n"); - - exit (0); -} - -#endif /* SHA256_TEST */ diff --git a/libclamav/sha256.h b/libclamav/sha256.h deleted file mode 100644 index bd8644986..000000000 --- a/libclamav/sha256.h +++ /dev/null @@ -1,66 +0,0 @@ -/*- - * Copyright (c) 2001-2003 Allan Saddi - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY ALLAN SADDI AND HIS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL ALLAN SADDI OR HIS CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $Id: sha256.h 348 2003-02-23 22:12:06Z asaddi $ - */ - -#ifndef _SHA256_H -#define _SHA256_H - -#include "cltypes.h" - -#define SHA256_HASH_SIZE 32 - -/* Hash size in 32-bit words */ -#define SHA256_HASH_WORDS 8 - -struct _SHA256Context { - uint64_t totalLength; - uint32_t hash[SHA256_HASH_WORDS]; - uint32_t bufferLength; - union { - uint32_t words[16]; - uint8_t bytes[64]; - } buffer; -#ifdef RUNTIME_ENDIAN - int littleEndian; -#endif /* RUNTIME_ENDIAN */ -}; - -typedef struct _SHA256Context SHA256_CTX; - -#ifdef __cplusplus -extern "C" { -#endif - -void sha256_init (SHA256_CTX *sc); -void sha256_update (SHA256_CTX *sc, const void *data, uint32_t len); -void sha256_final (SHA256_CTX *sc, uint8_t hash[SHA256_HASH_SIZE]); - -#ifdef __cplusplus -} -#endif - -#endif /* !_SHA256_H */ diff --git a/libclamav/sis.c b/libclamav/sis.c index a02d86ad9..b8c4121b0 100644 --- a/libclamav/sis.c +++ b/libclamav/sis.c @@ -38,6 +38,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "clamav.h" #include "scanners.h" diff --git a/libclamav/special.c b/libclamav/special.c index 020050136..7ac4640a8 100644 --- a/libclamav/special.c +++ b/libclamav/special.c @@ -33,6 +33,11 @@ #ifndef _WIN32 #include #endif + +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "cltypes.h" diff --git a/libclamav/spin.c b/libclamav/spin.c index 8d277c7b4..698800ac2 100644 --- a/libclamav/spin.c +++ b/libclamav/spin.c @@ -55,6 +55,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "pe.h" #include "rebuildpe.h" diff --git a/libclamav/stats.c b/libclamav/stats.c index a719bead9..e0e7a4817 100644 --- a/libclamav/stats.c +++ b/libclamav/stats.c @@ -44,6 +44,10 @@ #include +#include +#include +#include "libclamav/crypto.h" + #include "libclamav/others.h" #include "libclamav/clamav.h" #include "libclamav/dconf.h" diff --git a/libclamav/str.c b/libclamav/str.c index 6e821e4b8..4191df94a 100644 --- a/libclamav/str.c +++ b/libclamav/str.c @@ -33,6 +33,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "matcher.h" diff --git a/libclamav/swf.c b/libclamav/swf.c index bb3c5f65d..4c0d121dd 100644 --- a/libclamav/swf.c +++ b/libclamav/swf.c @@ -44,6 +44,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "swf.h" #include "clamav.h" diff --git a/libclamav/table.c b/libclamav/table.c index e1b688cf3..84ae8dd62 100644 --- a/libclamav/table.c +++ b/libclamav/table.c @@ -33,6 +33,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "table.h" #include "others.h" diff --git a/libclamav/text.c b/libclamav/text.c index bb2350989..3e03c2fd3 100644 --- a/libclamav/text.c +++ b/libclamav/text.c @@ -108,6 +108,10 @@ static char const rcsid[] = "$Id: text.c,v 1.25 2007/02/12 20:46:09 njh Exp $"; #include #include +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "mbox.h" diff --git a/libclamav/textdet.c b/libclamav/textdet.c index 30bc44a14..367ab99e4 100644 --- a/libclamav/textdet.c +++ b/libclamav/textdet.c @@ -43,6 +43,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "filetypes.h" #include "textdet.h" #include "others.h" diff --git a/libclamav/tnef.c b/libclamav/tnef.c index 785ed4c80..8cee39fc0 100644 --- a/libclamav/tnef.c +++ b/libclamav/tnef.c @@ -31,6 +31,10 @@ static char const rcsid[] = "$Id: tnef.c,v 1.41 2007/02/12 22:22:27 njh Exp $"; #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "clamav.h" #include "others.h" diff --git a/libclamav/unarj.c b/libclamav/unarj.c index 5b2dabbbd..567ff8162 100644 --- a/libclamav/unarj.c +++ b/libclamav/unarj.c @@ -36,6 +36,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "cltypes.h" #include "others.h" diff --git a/libclamav/uniq.c b/libclamav/uniq.c index e7775a324..d0d9c39ba 100644 --- a/libclamav/uniq.c +++ b/libclamav/uniq.c @@ -29,9 +29,12 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "uniq.h" #include "others.h" -#include "md5.h" struct uniq *uniq_init(uint32_t count) { struct uniq *U; @@ -57,12 +60,9 @@ void uniq_free(struct uniq *U) { uint32_t uniq_add(struct uniq *U, const char *key, uint32_t key_len, char **rhash) { unsigned int i; uint8_t digest[16]; - cli_md5_ctx md5; struct UNIQMD5 *m = NULL; - cli_md5_init(&md5); - cli_md5_update(&md5, key, key_len); - cli_md5_final(digest, &md5); + cl_hash_data("md5", key, key_len, digest, NULL); if(U->items && U->md5s[U->idx[*digest]].md5[0]==*digest) for(m=&U->md5s[U->idx[*digest]]; m; m=m->next) @@ -96,12 +96,9 @@ uint32_t uniq_add(struct uniq *U, const char *key, uint32_t key_len, char **rhas uint32_t uniq_get(struct uniq *U, const char *key, uint32_t key_len, char **rhash) { uint8_t digest[16]; - cli_md5_ctx md5; struct UNIQMD5 *m = NULL; - cli_md5_init(&md5); - cli_md5_update(&md5, key, key_len); - cli_md5_final(digest, &md5); + cl_hash_data("md5", key, key_len, digest, NULL); if(!U->items || U->md5s[U->idx[*digest]].md5[0]!=*digest) return 0; diff --git a/libclamav/unsp.c b/libclamav/unsp.c index 8d3fcc356..836a1f8b6 100644 --- a/libclamav/unsp.c +++ b/libclamav/unsp.c @@ -111,6 +111,10 @@ nsp1:00435A5A push 8000h #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "clamav.h" #include "others.h" diff --git a/libclamav/untar.c b/libclamav/untar.c index 517415583..9d8a29a2b 100644 --- a/libclamav/untar.c +++ b/libclamav/untar.c @@ -36,6 +36,10 @@ static char const rcsid[] = "$Id: untar.c,v 1.35 2007/02/12 20:46:09 njh Exp $"; #include /* for NAME_MAX */ #endif +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" #include "untar.h" diff --git a/libclamav/unzip.c b/libclamav/unzip.c index ca7c35424..eebcf1cc2 100644 --- a/libclamav/unzip.c +++ b/libclamav/unzip.c @@ -36,6 +36,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include #include "inflate64.h" #if HAVE_BZLIB_H diff --git a/libclamav/upack.c b/libclamav/upack.c index c3f3b0605..6608407f5 100644 --- a/libclamav/upack.c +++ b/libclamav/upack.c @@ -39,6 +39,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "pe.h" #include "rebuildpe.h" diff --git a/libclamav/upx.c b/libclamav/upx.c index bfa0e2751..9785cac7a 100644 --- a/libclamav/upx.c +++ b/libclamav/upx.c @@ -52,6 +52,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "upx.h" diff --git a/libclamav/uuencode.c b/libclamav/uuencode.c index 517f48d02..881f5d447 100644 --- a/libclamav/uuencode.c +++ b/libclamav/uuencode.c @@ -36,6 +36,11 @@ static char const rcsid[] = "$Id: uuencode.c,v 1.8 2006/12/11 11:55:11 njh Exp $ #ifdef HAVE_STRINGS_H #include #endif + +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "str.h" diff --git a/libclamav/vba_extract.c b/libclamav/vba_extract.c index b48d3032e..c521dbe64 100644 --- a/libclamav/vba_extract.c +++ b/libclamav/vba_extract.c @@ -34,6 +34,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "clamav.h" #include "others.h" diff --git a/libclamav/wwunpack.c b/libclamav/wwunpack.c index 7e0b16db6..8ec6df608 100644 --- a/libclamav/wwunpack.c +++ b/libclamav/wwunpack.c @@ -22,6 +22,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "others.h" #include "execs.h" diff --git a/libclamav/www.c b/libclamav/www.c index f20065a7c..69b311e23 100644 --- a/libclamav/www.c +++ b/libclamav/www.c @@ -40,6 +40,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "libclamav/others.h" #include "libclamav/clamav.h" #include "libclamav/www.h" diff --git a/libclamav/xar.c b/libclamav/xar.c index 20da56750..f6c339277 100644 --- a/libclamav/xar.c +++ b/libclamav/xar.c @@ -22,6 +22,10 @@ #include "clamav-config.h" #endif +#include +#include +#include "libclamav/crypto.h" + #include #include "xar.h" #include "fmap.h" @@ -36,8 +40,6 @@ #include "scanners.h" #include "inflate64.h" #include "lzma_iface.h" -#include "sha1.h" -#include "md5.h" /* xar_cleanup_temp_file - cleanup after cli_gentempfd @@ -323,16 +325,16 @@ static int xar_scan_subdocuments(xmlTextReaderPtr reader, cli_ctx *ctx) return rc; } -static void * xar_hash_init(int hash, SHA1Context *sc, cli_md5_ctx *mc) +static EVP_MD_CTX * xar_hash_init(int hash, EVP_MD_CTX *sc, EVP_MD_CTX *mc) { if (!sc && !mc) return NULL; switch (hash) { case XAR_CKSUM_SHA1: - SHA1Init(sc); + EVP_DigestInit(sc, EVP_sha1()); return sc; case XAR_CKSUM_MD5: - cli_md5_init(mc); + EVP_DigestInit(mc, EVP_md5()); return mc; case XAR_CKSUM_OTHER: case XAR_CKSUM_NONE: @@ -341,44 +343,33 @@ static void * xar_hash_init(int hash, SHA1Context *sc, cli_md5_ctx *mc) } } -static void xar_hash_update(void * hash_ctx, const void * data, unsigned long size, int hash) +static void xar_hash_update(EVP_MD_CTX * hash_ctx, const void * data, unsigned long size, int hash) { if (!hash_ctx || !data || !size) return; + switch (hash) { - case XAR_CKSUM_SHA1: - SHA1Update(hash_ctx, data, size); - return; - case XAR_CKSUM_MD5: - if (0 == cli_md5_update(hash_ctx, data, size)) { - cli_dbgmsg("cli_scanxar: cli_md5_update invalid return.\n"); - return; - } - return; - case XAR_CKSUM_OTHER: case XAR_CKSUM_NONE: - default: + case XAR_CKSUM_OTHER: return; } + + EVP_DigestUpdate(hash_ctx, data, size); } -static void xar_hash_final(void * hash_ctx, void * result, int hash) +static void xar_hash_final(EVP_MD_CTX * hash_ctx, void * result, int hash) { - if (!hash_ctx || !result) return; + switch (hash) { - case XAR_CKSUM_SHA1: - SHA1Final(hash_ctx, result); - return; - case XAR_CKSUM_MD5: - cli_md5_final(result, hash_ctx); - return; case XAR_CKSUM_OTHER: case XAR_CKSUM_NONE: default: return; } + + EVP_DigestFinal(hash_ctx, result, NULL); } static int xar_hash_check(int hash, const void * result, const void * expected) @@ -538,9 +529,9 @@ int cli_scanxar(cli_ctx *ctx) &a_cksum, &a_hash, &e_cksum, &e_hash))) { int do_extract_cksum = 1; unsigned char * blockp; - SHA1Context a_sc, e_sc; - cli_md5_ctx a_mc, e_mc; - void *a_hash_ctx, *e_hash_ctx; + EVP_MD_CTX a_sc, e_sc; + EVP_MD_CTX a_mc, e_mc; + EVP_MD_CTX *a_hash_ctx, *e_hash_ctx; char result[SHA1_HASH_SIZE]; char * expected; diff --git a/libclamav/xz_iface.c b/libclamav/xz_iface.c index 7065d21d9..fe685bb6b 100644 --- a/libclamav/xz_iface.c +++ b/libclamav/xz_iface.c @@ -22,7 +22,10 @@ #include "clamav-config.h" #endif -#include "7z/Sha256.h" +#include +#include +#include "libclamav/crypto.h" + #include "7z/XzCrc64.h" #include "xz_iface.h" diff --git a/libclamav/yc.c b/libclamav/yc.c index 6d9074c0d..abe1c3d0d 100644 --- a/libclamav/yc.c +++ b/libclamav/yc.c @@ -30,6 +30,11 @@ #if HAVE_CONFIG_H #include "clamav-config.h" #endif + +#include +#include +#include "libclamav/crypto.h" + #include "cltypes.h" #include "pe.h" #include "others.h" diff --git a/libltdl/Makefile.in b/libltdl/Makefile.in index 957e18f9b..364b19470 100644 --- a/libltdl/Makefile.in +++ b/libltdl/Makefile.in @@ -126,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/shared/Makefile.in b/shared/Makefile.in index 86527cd76..73a3160df 100644 --- a/shared/Makefile.in +++ b/shared/Makefile.in @@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/shared/cdiff.c b/shared/cdiff.c index 7114adb5d..4eb51c585 100644 --- a/shared/cdiff.c +++ b/shared/cdiff.c @@ -32,10 +32,13 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "shared/misc.h" #include "shared/output.h" #include "shared/cdiff.h" -#include "libclamav/sha256.h" #include "libclamav/str.h" #include "libclamav/others.h" @@ -764,7 +767,7 @@ int cdiff_apply(int fd, unsigned short mode) int end, i, n; struct stat sb; int desc; - SHA256_CTX sha256ctx; + EVP_MD_CTX sha256ctx; unsigned char digest[32]; int sum, bread; #define DSIGBUFF 350 @@ -848,18 +851,18 @@ int cdiff_apply(int fd, unsigned short mode) return -1; } - sha256_init(&sha256ctx); + EVP_DigestInit(&sha256ctx, EVP_sha256()); sum = 0; while((bread = read(desc, buff, FILEBUFF)) > 0) { if(sum + bread >= end) { - sha256_update(&sha256ctx, (unsigned char *) buff, end - sum); + EVP_DigestUpdate(&sha256ctx, (unsigned char *) buff, end - sum); break; } else { - sha256_update(&sha256ctx, (unsigned char *) buff, bread); + EVP_DigestUpdate(&sha256ctx, (unsigned char *) buff, bread); } sum += bread; } - sha256_final(&sha256ctx, digest); + EVP_DigestFinal(&sha256ctx, digest, NULL); if(cli_versig2(digest, dsig, PSS_NSTR, PSS_ESTR) != CL_SUCCESS) { logg("!cdiff_apply: Incorrect digital signature\n"); diff --git a/shared/misc.c b/shared/misc.c index 087d0443e..7ac75b71d 100644 --- a/shared/misc.c +++ b/shared/misc.c @@ -39,6 +39,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "shared/optparser.h" #include "shared/output.h" diff --git a/shared/optparser.c b/shared/optparser.c index 68cca3b06..983a06346 100644 --- a/shared/optparser.c +++ b/shared/optparser.c @@ -38,6 +38,10 @@ #endif #include +#include +#include +#include "libclamav/crypto.h" + #include "shared/optparser.h" #include "shared/misc.h" diff --git a/shared/output.c b/shared/output.c index 3af3acd12..1462e1418 100644 --- a/shared/output.c +++ b/shared/output.c @@ -50,6 +50,10 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "output.h" #include "libclamav/others.h" #include "libclamav/str.h" diff --git a/sigtool/Makefile.in b/sigtool/Makefile.in index cb595db6b..1b6932bfe 100644 --- a/sigtool/Makefile.in +++ b/sigtool/Makefile.in @@ -137,6 +137,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/sigtool/sigtool.c b/sigtool/sigtool.c index 1f46507ca..5d52e1db1 100644 --- a/sigtool/sigtool.c +++ b/sigtool/sigtool.c @@ -51,14 +51,16 @@ #include #endif +#include +#include +#include "libclamav/crypto.h" + #include "vba.h" #include "shared/output.h" #include "shared/optparser.h" #include "shared/misc.h" #include "shared/cdiff.h" -#include "libclamav/sha1.h" -#include "libclamav/sha256.h" #include "shared/tar.h" #include "libclamav/clamav.h" @@ -398,10 +400,10 @@ static char *sha256file(const char *file, unsigned int *size) unsigned int i, bytes; unsigned char digest[32], buffer[FILEBUFF]; char *sha; - SHA256_CTX ctx; + EVP_MD_CTX ctx; - sha256_init(&ctx); + EVP_DigestInit(&ctx, EVP_sha256()); if(!(fh = fopen(file, "rb"))) { mprintf("!sha256file: Can't open file %s\n", file); return NULL; @@ -409,11 +411,11 @@ static char *sha256file(const char *file, unsigned int *size) if(size) *size = 0; while((bytes = fread(buffer, 1, sizeof(buffer), fh))) { - sha256_update(&ctx, buffer, bytes); + EVP_DigestUpdate(&ctx, buffer, bytes); if(size) *size += bytes; } - sha256_final(&ctx, digest); + EVP_DigestFinal(&ctx, digest, NULL); sha = (char *) malloc(65); if(!sha) { @@ -433,7 +435,7 @@ static int writeinfo(const char *dbname, const char *builder, const char *header unsigned int i, bytes; char file[32], *pt, dbfile[32]; unsigned char digest[32], buffer[FILEBUFF]; - SHA256_CTX ctx; + EVP_MD_CTX ctx; snprintf(file, sizeof(file), "%s.info", dbname); if(!access(file, R_OK)) { @@ -490,10 +492,10 @@ static int writeinfo(const char *dbname, const char *builder, const char *header } if(!optget(opts, "unsigned")->enabled) { rewind(fh); - sha256_init(&ctx); + EVP_DigestInit(&ctx, EVP_sha256()); while((bytes = fread(buffer, 1, sizeof(buffer), fh))) - sha256_update(&ctx, buffer, bytes); - sha256_final(&ctx, digest); + EVP_DigestUpdate(&ctx, buffer, bytes); + EVP_DigestFinal(&ctx, digest, NULL); if(!(pt = getdsig(optget(opts, "server")->strarg, builder, digest, 32, 3))) { mprintf("!writeinfo: Can't get digital signature from remote server\n"); fclose(fh); @@ -513,7 +515,7 @@ static int script2cdiff(const char *script, const char *builder, const struct op { char *cdiff, *pt, buffer[FILEBUFF]; unsigned char digest[32]; - SHA256_CTX ctx; + EVP_MD_CTX ctx; STATBUF sb; FILE *scripth, *cdiffh; gzFile gzh; @@ -597,13 +599,13 @@ static int script2cdiff(const char *script, const char *builder, const struct op return -1; } - sha256_init(&ctx); + EVP_DigestInit(&ctx, EVP_sha256()); while((bytes = fread(buffer, 1, sizeof(buffer), cdiffh))) - sha256_update(&ctx, (unsigned char *) buffer, bytes); + EVP_DigestUpdate(&ctx, (unsigned char *) buffer, bytes); fclose(cdiffh); - sha256_final(&ctx, digest); + EVP_DigestFinal(&ctx, digest, NULL); if(!(pt = getdsig(optget(opts, "server")->strarg, builder, digest, 32, 2))) { mprintf("!script2cdiff: Can't get digital signature from remote server\n"); @@ -2788,7 +2790,6 @@ static int dumpcerts(const struct optstruct *opts) char * filename = NULL; STATBUF sb; const char * fmptr; - SHA1Context sha1; struct cl_engine *engine; cli_ctx ctx; int fd, ret; @@ -2869,9 +2870,7 @@ static int dumpcerts(const struct optstruct *opts) } /* Generate SHA1 */ - SHA1Init(&sha1); - SHA1Update(&sha1, fmptr, sb.st_size); - SHA1Final(&sha1, shash1); + cl_sha1(fmptr, sb.st_size, shash1, NULL); ret = cli_checkfp_pe(&ctx, shash1, NULL, CL_CHECKFP_PE_FLAG_AUTHENTICODE); diff --git a/sigtool/vba.c b/sigtool/vba.c index fde3f71a1..08b2806e0 100644 --- a/sigtool/vba.c +++ b/sigtool/vba.c @@ -33,6 +33,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "libclamav/clamav.h" #include "libclamav/vba_extract.h" #include "libclamav/cltypes.h" diff --git a/test/Makefile.in b/test/Makefile.in index 56529143d..d175eb36e 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/unit_tests/Makefile.in b/unit_tests/Makefile.in index 89158d0b9..8bfa0d492 100644 --- a/unit_tests/Makefile.in +++ b/unit_tests/Makefile.in @@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ + $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/unit_tests/check_bytecode.c b/unit_tests/check_bytecode.c index fc3731504..154e02028 100644 --- a/unit_tests/check_bytecode.c +++ b/unit_tests/check_bytecode.c @@ -31,6 +31,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "../libclamav/clamav.h" #include "../libclamav/others.h" #include "../libclamav/bytecode.h" diff --git a/unit_tests/check_clamav.c b/unit_tests/check_clamav.c index a44b00182..02f758b02 100644 --- a/unit_tests/check_clamav.c +++ b/unit_tests/check_clamav.c @@ -12,12 +12,16 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "../libclamav/clamav.h" #include "../libclamav/others.h" #include "../libclamav/matcher.h" #include "../libclamav/version.h" #include "../libclamav/dsig.h" -#include "../libclamav/sha256.h" #include "../libclamav/fpu.h" #include "checks.h" @@ -790,27 +794,23 @@ static uint8_t res256[3][SHA256_HASH_SIZE] = { START_TEST (test_sha256) { - SHA256_CTX sha256; + EVP_MD_CTX sha256; uint8_t hsha256[SHA256_HASH_SIZE]; uint8_t buf[1000]; int i; memset (buf, 0x61, sizeof (buf)); - sha256_init (&sha256); - sha256_update (&sha256, tv1, sizeof (tv1)); - sha256_final (&sha256, hsha256); + cl_sha256(tv1, sizeof(tv1), hsha256, NULL); fail_unless(!memcmp (hsha256, res256[0], sizeof (hsha256)), "sha256 test vector #1 failed"); - sha256_init (&sha256); - sha256_update (&sha256, tv2, sizeof (tv2)); - sha256_final (&sha256, hsha256); + cl_sha256(tv2, sizeof(tv2), hsha256, NULL); fail_unless(!memcmp (hsha256, res256[1], sizeof (hsha256)), "sha256 test vector #2 failed"); - sha256_init (&sha256); + EVP_DigestInit (&sha256, EVP_sha256()); for (i = 0; i < 1000; i++) - sha256_update (&sha256, buf, sizeof (buf)); - sha256_final (&sha256, hsha256); + EVP_DigestUpdate (&sha256, buf, sizeof (buf)); + EVP_DigestFinal (&sha256, hsha256, NULL); fail_unless(!memcmp (hsha256, res256[2], sizeof (hsha256)), "sha256 test vector #3 failed"); } END_TEST diff --git a/unit_tests/check_disasm.c b/unit_tests/check_disasm.c index 21c9805f7..13278a548 100644 --- a/unit_tests/check_disasm.c +++ b/unit_tests/check_disasm.c @@ -32,6 +32,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "../libclamav/clamav.h" #include "../libclamav/others.h" #include "../libclamav/disasm.h" diff --git a/unit_tests/check_htmlnorm.c b/unit_tests/check_htmlnorm.c index 583ec29e4..1feec6255 100644 --- a/unit_tests/check_htmlnorm.c +++ b/unit_tests/check_htmlnorm.c @@ -22,6 +22,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "checks.h" #include "../libclamav/fmap.h" #include "../libclamav/dconf.h" diff --git a/unit_tests/check_jsnorm.c b/unit_tests/check_jsnorm.c index d00dd6816..81e097778 100644 --- a/unit_tests/check_jsnorm.c +++ b/unit_tests/check_jsnorm.c @@ -32,6 +32,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "../libclamav/clamav.h" #include "../libclamav/others.h" #include "../libclamav/dconf.h" diff --git a/unit_tests/check_matchers.c b/unit_tests/check_matchers.c index 9a66c98dd..741e99e95 100644 --- a/unit_tests/check_matchers.c +++ b/unit_tests/check_matchers.c @@ -25,6 +25,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "../libclamav/clamav.h" #include "../libclamav/readdb.h" #include "../libclamav/matcher.h" diff --git a/unit_tests/check_regex.c b/unit_tests/check_regex.c index 1f0719535..bd51793cf 100644 --- a/unit_tests/check_regex.c +++ b/unit_tests/check_regex.c @@ -28,6 +28,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "../libclamav/clamav.h" #include "../libclamav/others.h" #include "../libclamav/mbox.h" diff --git a/unit_tests/check_str.c b/unit_tests/check_str.c index 398e958e9..6ea521a4d 100644 --- a/unit_tests/check_str.c +++ b/unit_tests/check_str.c @@ -29,6 +29,11 @@ #include #include #include + +#include +#include +#include "libclamav/crypto.h" + #include "../libclamav/clamav.h" #include "../libclamav/others.h" #include "../libclamav/str.h" From 7fb5036fb22e77a8b10afce6895fc2222be7e05a Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Sat, 8 Feb 2014 01:42:41 -0500 Subject: [PATCH 3/7] Make Valgrind happy. Rely less on EVP_MD_CTX_create. --- libclamav/asn1.c | 41 +++++--------- libclamav/cache.c | 12 ++--- libclamav/crypto.c | 113 ++++++++------------------------------- libclamav/cvd.c | 9 +--- libclamav/cvd.h | 2 +- libclamav/dsig.c | 26 +++------ libclamav/matcher.c | 62 ++++----------------- libclamav/mbox.c | 10 +--- libclamav/others.c | 17 +++--- libclamav/pe.c | 29 +++------- libclamav/phishcheck.c | 15 ++---- libclamav/readdb.c | 6 +-- unit_tests/valgrind.supp | 10 ++++ 13 files changed, 93 insertions(+), 259 deletions(-) diff --git a/libclamav/asn1.c b/libclamav/asn1.c index a69d122b6..7655ade6d 100644 --- a/libclamav/asn1.c +++ b/libclamav/asn1.c @@ -731,7 +731,7 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg unsigned int dsize, message_size, attrs_size; cli_crt_hashtype hashtype; cli_crt *x509; - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; int result; int isBlacklisted = 0; @@ -1021,15 +1021,10 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg break; } - ctx = EVP_MD_CTX_create(); - if (!(ctx)) - break; - - EVP_DigestInit(ctx, EVP_sha1()); - EVP_DigestUpdate(ctx, "\x31", 1); - EVP_DigestUpdate(ctx, attrs + 1, attrs_size - 1); - EVP_DigestFinal(ctx, sha1, NULL); - EVP_MD_CTX_destroy(ctx); + EVP_DigestInit(&ctx, EVP_sha1()); + EVP_DigestUpdate(&ctx, "\x31", 1); + EVP_DigestUpdate(&ctx, attrs + 1, attrs_size - 1); + EVP_DigestFinal(&ctx, sha1, NULL); if(!fmap_need_ptr_once(map, asn1.content, asn1.size)) { cli_dbgmsg("asn1_parse_mscat: failed to read encryptedDigest\n"); @@ -1267,25 +1262,15 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg } if(hashtype == CLI_SHA1RSA) { - ctx = EVP_MD_CTX_create(); - if (!(ctx)) - break; - - EVP_DigestInit(ctx, EVP_sha1()); - EVP_DigestUpdate(ctx, "\x31", 1); - EVP_DigestUpdate(ctx, attrs + 1, attrs_size - 1); - EVP_DigestFinal(ctx, sha1, NULL); - EVP_MD_CTX_destroy(ctx); + EVP_DigestInit(&ctx, EVP_sha1()); + EVP_DigestUpdate(&ctx, "\x31", 1); + EVP_DigestUpdate(&ctx, attrs + 1, attrs_size - 1); + EVP_DigestFinal(&ctx, sha1, NULL); } else { - ctx = EVP_MD_CTX_create(); - if (!(ctx)) - break; - - EVP_DigestInit(ctx, EVP_md5()); - EVP_DigestUpdate(ctx, "\x31", 1); - EVP_DigestUpdate(ctx, attrs + 1, attrs_size - 1); - EVP_DigestFinal(ctx, sha1, NULL); - EVP_MD_CTX_destroy(ctx); + EVP_DigestInit(&ctx, EVP_md5()); + EVP_DigestUpdate(&ctx, "\x31", 1); + EVP_DigestUpdate(&ctx, attrs + 1, attrs_size - 1); + EVP_DigestFinal(&ctx, sha1, NULL); } if(!fmap_need_ptr_once(map, asn1.content, asn1.size)) { diff --git a/libclamav/cache.c b/libclamav/cache.c index 547fdb02e..417f5eaa7 100644 --- a/libclamav/cache.c +++ b/libclamav/cache.c @@ -905,7 +905,7 @@ void cache_remove(unsigned char *md5, size_t size, const struct cl_engine *engin int cache_check(unsigned char *hash, cli_ctx *ctx) { fmap_t *map; size_t todo, at = 0; - EVP_MD_CTX *hashctx; + EVP_MD_CTX hashctx; int ret; if(!ctx || !ctx->engine || !ctx->engine->cache) @@ -919,10 +919,7 @@ int cache_check(unsigned char *hash, cli_ctx *ctx) { map = *ctx->fmap; todo = map->len; - hashctx = EVP_MD_CTX_create(); - if (!(hashctx)) - return CL_VIRUS; - EVP_DigestInit(hashctx, EVP_md5()); + EVP_DigestInit(&hashctx, EVP_md5()); while(todo) { const void *buf; @@ -934,14 +931,13 @@ int cache_check(unsigned char *hash, cli_ctx *ctx) { todo -= readme; at += readme; - if (!EVP_DigestUpdate(hashctx, buf, readme)) { + if (!EVP_DigestUpdate(&hashctx, buf, readme)) { cli_errmsg("cache_check: error reading while generating hash!\n"); return CL_EREAD; } } - EVP_DigestFinal(hashctx, hash, NULL); - EVP_MD_CTX_destroy(hashctx); + EVP_DigestFinal(&hashctx, hash, NULL); ret = cache_lookup_hash(hash, map->len, ctx->engine->cache, ctx->recursion); cli_dbgmsg("cache_check: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x is %s\n", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], (ret == CL_VIRUS) ? "negative" : "positive"); diff --git a/libclamav/crypto.c b/libclamav/crypto.c index 1a2d94c76..bbae1b44c 100644 --- a/libclamav/crypto.c +++ b/libclamav/crypto.c @@ -78,7 +78,7 @@ void cl_cleanup_crypto(void) unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned char *obuf, unsigned int *olen) { - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; unsigned char *ret; size_t mdsz; const EVP_MD *md; @@ -95,55 +95,42 @@ unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned cha if (!(ret)) return NULL; - ctx = EVP_MD_CTX_create(); - if (!(ctx)) { - if (!(obuf)) - free(ret); - - return NULL; - } - - if (!EVP_DigestInit(ctx, md)) { + if (!EVP_DigestInit(&ctx, md)) { if (!(obuf)) free(ret); if ((olen)) *olen = 0; - EVP_MD_CTX_destroy(ctx); return NULL; } cur=0; while (cur < len) { size_t todo = MIN(EVP_MD_block_size(md), len-cur); - if (!EVP_DigestUpdate(ctx, (void *)(((unsigned char *)buf)+cur), todo)) { + if (!EVP_DigestUpdate(&ctx, (void *)(((unsigned char *)buf)+cur), todo)) { if (!(obuf)) free(ret); if ((olen)) *olen = 0; - EVP_MD_CTX_destroy(ctx); return NULL; } cur += todo; } - if (!EVP_DigestFinal(ctx, ret, &i)) { + if (!EVP_DigestFinal(&ctx, ret, &i)) { if (!(obuf)) free(ret); if ((olen)) *olen = 0; - EVP_MD_CTX_destroy(ctx); return NULL; } - EVP_MD_CTX_destroy(ctx); - if ((olen)) *olen = i; @@ -152,7 +139,7 @@ unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned cha unsigned char *cl_hash_file_fd(int fd, char *alg, unsigned int *olen) { - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; const EVP_MD *md; unsigned char *res; @@ -160,18 +147,12 @@ unsigned char *cl_hash_file_fd(int fd, char *alg, unsigned int *olen) if (!(md)) return NULL; - ctx = EVP_MD_CTX_create(); - if (!(ctx)) - return NULL; - - if (!EVP_DigestInit(ctx, md)) { - EVP_MD_CTX_destroy(ctx); + if (!EVP_DigestInit(&ctx, md)) { return NULL; } - res = cl_hash_file_fd_ctx(ctx, fd, olen); + res = cl_hash_file_fd_ctx(&ctx, fd, olen); - EVP_MD_CTX_destroy(ctx); return res; } @@ -259,7 +240,7 @@ unsigned char *cl_sha1(const void *buf, size_t len, unsigned char *obuf, unsigne int cl_verify_signature_hash(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *digest) { - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; const EVP_MD *md; size_t mdsz; @@ -269,33 +250,24 @@ int cl_verify_signature_hash(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsi mdsz = EVP_MD_size(md); - ctx = EVP_MD_CTX_create(); - if (!(ctx)) { - return -1; - } - - if (!EVP_VerifyInit(ctx, md)) { - EVP_MD_CTX_destroy(ctx); + if (!EVP_VerifyInit(&ctx, md)) { return -1; } - if (!EVP_VerifyUpdate(ctx, digest, mdsz)) { - EVP_MD_CTX_destroy(ctx); + if (!EVP_VerifyUpdate(&ctx, digest, mdsz)) { return -1; } - if (EVP_VerifyFinal(ctx, sig, siglen, pkey) != 0) { - EVP_MD_CTX_destroy(ctx); + if (EVP_VerifyFinal(&ctx, sig, siglen, pkey) != 0) { return -1; } - EVP_MD_CTX_destroy(ctx); return 0; } int cl_verify_signature_fd(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, int fd) { - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; const EVP_MD *md; size_t mdsz; unsigned char *digest; @@ -310,38 +282,28 @@ int cl_verify_signature_fd(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsign mdsz = EVP_MD_size(md); - ctx = EVP_MD_CTX_create(); - if (!(ctx)) { - free(digest); - return -1; - } - - if (!EVP_VerifyInit(ctx, md)) { + if (!EVP_VerifyInit(&ctx, md)) { free(digest); - EVP_MD_CTX_destroy(ctx); return -1; } - if (!EVP_VerifyUpdate(ctx, digest, mdsz)) { + if (!EVP_VerifyUpdate(&ctx, digest, mdsz)) { free(digest); - EVP_MD_CTX_destroy(ctx); return -1; } - if (EVP_VerifyFinal(ctx, sig, siglen, pkey) != 0) { + if (EVP_VerifyFinal(&ctx, sig, siglen, pkey) != 0) { free(digest); - EVP_MD_CTX_destroy(ctx); return -1; } - EVP_MD_CTX_destroy(ctx); free(digest); return 0; } int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned int siglen, unsigned char *data, size_t datalen, int decode) { - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; const EVP_MD *md; size_t mdsz; unsigned char *digest; @@ -377,8 +339,7 @@ int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned mdsz = EVP_MD_size(md); - ctx = EVP_MD_CTX_create(); - if (!(ctx)) { + if (!EVP_VerifyInit(&ctx, md)) { free(digest); if (decode) free(sig); @@ -386,9 +347,7 @@ int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned return -1; } - if (!EVP_VerifyInit(ctx, md)) { - EVP_MD_CTX_destroy(ctx); - + if (!EVP_VerifyUpdate(&ctx, digest, mdsz)) { free(digest); if (decode) free(sig); @@ -396,9 +355,7 @@ int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned return -1; } - if (!EVP_VerifyUpdate(ctx, digest, mdsz)) { - EVP_MD_CTX_destroy(ctx); - + if (EVP_VerifyFinal(&ctx, sig, siglen, pkey) != 0) { free(digest); if (decode) free(sig); @@ -406,18 +363,6 @@ int cl_verify_signature(EVP_PKEY *pkey, char *alg, unsigned char *sig, unsigned return -1; } - if (EVP_VerifyFinal(ctx, sig, siglen, pkey) != 0) { - EVP_MD_CTX_destroy(ctx); - - free(digest); - if (decode) - free(sig); - - return -1; - } - - EVP_MD_CTX_destroy(ctx); - if (decode) free(sig); @@ -579,7 +524,7 @@ unsigned char *cl_sign_data_keyfile(char *keypath, char *alg, unsigned char *has unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsigned int *olen, int encode) { - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; const EVP_MD *md; unsigned int siglen; unsigned char *sig; @@ -588,35 +533,25 @@ unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsi if (!(md)) return NULL; - ctx = EVP_MD_CTX_create(); - if (!(ctx)) { - free(hash); - return NULL; - } - sig = (unsigned char *)calloc(1, EVP_PKEY_size(pkey)); if (!(sig)) { - EVP_MD_CTX_destroy(ctx); free(hash); return NULL; } - if (!EVP_SignInit(ctx, md)) { - EVP_MD_CTX_destroy(ctx); + if (!EVP_SignInit(&ctx, md)) { free(sig); free(hash); return NULL; } - if (!EVP_SignUpdate(ctx, hash, EVP_MD_size(md))) { - EVP_MD_CTX_destroy(ctx); + if (!EVP_SignUpdate(&ctx, hash, EVP_MD_size(md))) { free(sig); free(hash); return NULL; } - if (!EVP_SignFinal(ctx, sig, &siglen, pkey)) { - EVP_MD_CTX_destroy(ctx); + if (!EVP_SignFinal(&ctx, sig, &siglen, pkey)) { free(sig); free(hash); return NULL; @@ -625,7 +560,6 @@ unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsi if (encode) { unsigned char *newsig = (unsigned char *)cl_base64_encode(sig, siglen); if (!(newsig)) { - EVP_MD_CTX_destroy(ctx); free(sig); free(hash); return NULL; @@ -636,7 +570,6 @@ unsigned char *cl_sign_data(EVP_PKEY *pkey, char *alg, unsigned char *hash, unsi siglen = (unsigned int)strlen((const char *)newsig); } - EVP_MD_CTX_destroy(ctx); free(hash); *olen = siglen; diff --git a/libclamav/cvd.c b/libclamav/cvd.c index 38f54f2b3..d69456e96 100644 --- a/libclamav/cvd.c +++ b/libclamav/cvd.c @@ -315,12 +315,7 @@ static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, un dbio->readsize = dbio->size < dbio->bufsize ? dbio->size : dbio->bufsize - 1; dbio->bufpt = NULL; dbio->readpt = dbio->buf; - dbio->hashctx = EVP_MD_CTX_create(); - if (!(dbio->hashctx)) { - cli_tgzload_cleanup(compr, dbio, fdd); - return CL_EMALFDB;; - } - EVP_DigestInit(dbio->hashctx, EVP_sha256()); + EVP_DigestInit(&(dbio->hashctx), EVP_sha256()); dbio->bread = 0; /* cli_dbgmsg("cli_tgzload: Loading %s, size: %u\n", name, size); */ @@ -354,7 +349,7 @@ static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, un cli_tgzload_cleanup(compr, dbio, fdd); return CL_EMALFDB; } - EVP_DigestFinal(dbio->hashctx, hash, NULL); + EVP_DigestFinal(&(dbio->hashctx), hash, NULL); if(memcmp(db->hash, hash, 32)) { cli_errmsg("cli_tgzload: Invalid checksum for file %s\n", name); cli_tgzload_cleanup(compr, dbio, fdd); diff --git a/libclamav/cvd.h b/libclamav/cvd.h index 0257b829d..22588e99c 100644 --- a/libclamav/cvd.h +++ b/libclamav/cvd.h @@ -32,7 +32,7 @@ struct cli_dbio { char *buf, *bufpt, *readpt; unsigned int usebuf, bufsize, readsize; unsigned int chkonly; - EVP_MD_CTX *hashctx; + EVP_MD_CTX hashctx; }; int cli_cvdload(FILE *fs, struct cl_engine *engine, unsigned int *signo, unsigned int options, unsigned int dbtype, const char *filename, unsigned int chkonly); diff --git a/libclamav/dsig.c b/libclamav/dsig.c index 333f4119b..10450414d 100644 --- a/libclamav/dsig.c +++ b/libclamav/dsig.c @@ -158,7 +158,7 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n unsigned char *decoded, digest1[HASH_LEN], digest2[HASH_LEN], digest3[HASH_LEN], *salt; unsigned char mask[BLK_LEN], data[BLK_LEN], final[8 + 2 * HASH_LEN], c[4]; unsigned int i, rounds; - EVP_MD_CTX *ctx; + EVP_MD_CTX ctx; mp_int n, e; mp_init(&e); @@ -187,15 +187,10 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n c[2] = (unsigned char) (i / 256); c[3] = (unsigned char) i; - ctx = EVP_MD_CTX_create(); - if (!(ctx)) - return CL_EVERIFY; - - EVP_DigestInit(ctx, EVP_sha256()); - EVP_DigestUpdate(ctx, digest2, HASH_LEN); - EVP_DigestUpdate(ctx, c, 4); - EVP_DigestFinal(ctx, digest3, NULL); - EVP_MD_CTX_destroy(ctx); + EVP_DigestInit(&ctx, EVP_sha256()); + EVP_DigestUpdate(&ctx, digest2, HASH_LEN); + EVP_DigestUpdate(&ctx, c, 4); + EVP_DigestFinal(&ctx, digest3, NULL); if(i + 1 == rounds) memcpy(&data[i * 32], digest3, BLK_LEN - i * HASH_LEN); else @@ -217,14 +212,9 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n memcpy(&final[8], sha256, HASH_LEN); memcpy(&final[8 + HASH_LEN], salt, SALT_LEN); - ctx = EVP_MD_CTX_create(); - if (!(ctx)) - return CL_EVERIFY; - - EVP_DigestInit(ctx, EVP_sha256()); - EVP_DigestUpdate(ctx, final, sizeof(final)); - EVP_DigestFinal(ctx, digest1, NULL); - EVP_MD_CTX_destroy(ctx); + EVP_DigestInit(&ctx, EVP_sha256()); + EVP_DigestUpdate(&ctx, final, sizeof(final)); + EVP_DigestFinal(&ctx, digest1, NULL); return memcmp(digest1, digest2, HASH_LEN) ? CL_EVERIFY : CL_SUCCESS; } diff --git a/libclamav/matcher.c b/libclamav/matcher.c index 4869b890d..63002d46f 100644 --- a/libclamav/matcher.c +++ b/libclamav/matcher.c @@ -718,48 +718,22 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli const char *virname = NULL; uint32_t viroffset = 0; uint32_t viruses_found = 0; - EVP_MD_CTX *md5ctx, *sha1ctx, *sha256ctx; + EVP_MD_CTX md5ctx, sha1ctx, sha256ctx; if(!ctx->engine) { cli_errmsg("cli_scandesc: engine == NULL\n"); return CL_ENULLARG; } - md5ctx = EVP_MD_CTX_create(); - if (!(md5ctx)) - return CL_CLEAN; - - sha1ctx = EVP_MD_CTX_create(); - if (!(sha1ctx)) { - EVP_MD_CTX_destroy(md5ctx); - return CL_CLEAN; - } - - sha256ctx = EVP_MD_CTX_create(); - if (!(sha256ctx)) { - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); + if (!EVP_DigestInit(&md5ctx, EVP_md5())) { return CL_CLEAN; } - if (!EVP_DigestInit(md5ctx, EVP_md5())) { - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); + if (!EVP_DigestInit(&sha1ctx, EVP_sha1())) { return CL_CLEAN; } - if (!EVP_DigestInit(sha1ctx, EVP_sha1())) { - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); - return CL_CLEAN; - } - - if (!EVP_DigestInit(sha256ctx, EVP_sha256())) { - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); + if (!EVP_DigestInit(&sha256ctx, EVP_sha256())) { return CL_CLEAN; } @@ -795,9 +769,6 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); return ret; } } @@ -810,9 +781,6 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); return ret; } if(troot->bm_offmode) { @@ -826,9 +794,6 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); return ret; } @@ -895,9 +860,6 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); return ret; } } @@ -934,11 +896,11 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli uint32_t data_len = bytes - maxpatlen * (offset!=0); if(compute_hash[CLI_HASH_MD5]) - EVP_DigestUpdate(md5ctx, data, data_len); + EVP_DigestUpdate(&md5ctx, data, data_len); if(compute_hash[CLI_HASH_SHA1]) - EVP_DigestUpdate(sha1ctx, data, data_len); + EVP_DigestUpdate(&sha1ctx, data, data_len); if(compute_hash[CLI_HASH_SHA256]) - EVP_DigestUpdate(sha256ctx, data, data_len); + EVP_DigestUpdate(&sha256ctx, data, data_len); } } @@ -957,13 +919,13 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli enum CLI_HASH_TYPE hashtype, hashtype2; if(compute_hash[CLI_HASH_MD5]) - EVP_DigestFinal(md5ctx, digest[CLI_HASH_MD5], NULL); + EVP_DigestFinal(&md5ctx, digest[CLI_HASH_MD5], NULL); if(refhash) compute_hash[CLI_HASH_MD5] = 1; if(compute_hash[CLI_HASH_SHA1]) - EVP_DigestFinal(sha1ctx, digest[CLI_HASH_SHA1], NULL); + EVP_DigestFinal(&sha1ctx, digest[CLI_HASH_SHA1], NULL); if(compute_hash[CLI_HASH_SHA256]) - EVP_DigestFinal(sha256ctx, digest[CLI_HASH_SHA256], NULL); + EVP_DigestFinal(&sha256ctx, digest[CLI_HASH_SHA256], NULL); virname = NULL; for(hashtype = CLI_HASH_MD5; hashtype < CLI_HASH_AVAIL_TYPES; hashtype++) { @@ -1020,10 +982,6 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli } } - EVP_MD_CTX_destroy(md5ctx); - EVP_MD_CTX_destroy(sha1ctx); - EVP_MD_CTX_destroy(sha256ctx); - if(troot) { if(ret != CL_VIRUS || SCAN_ALL) ret = cli_lsig_eval(ctx, troot, &tdata, &info, refhash); diff --git a/libclamav/mbox.c b/libclamav/mbox.c index 6f2224379..7832f4331 100644 --- a/libclamav/mbox.c +++ b/libclamav/mbox.c @@ -2796,7 +2796,6 @@ rfc1341(message *m, const char *dir) int n; char pdir[NAME_MAX + 1]; unsigned char md5_val[16]; - EVP_MD_CTX *ctx; char *md5_hex; id = (char *)messageFindArgument(m, "id"); @@ -2853,14 +2852,7 @@ rfc1341(message *m, const char *dir) } n = atoi(number); - ctx = EVP_MD_CTX_create(); - if (!(ctx)) { - free(id); - return CL_EMEM; - } - EVP_DigestInit(ctx, EVP_md5()); - EVP_DigestUpdate(ctx, id, strlen(id)); - EVP_DigestFinal(ctx, md5_val, NULL); + cl_hash_data("md5", id, strlen(id), md5_val, NULL); md5_hex = cli_str2hex((const char*)md5_val, 16); if(!md5_hex) { diff --git a/libclamav/others.c b/libclamav/others.c index 6bb5155b5..ef1ca664b 100644 --- a/libclamav/others.c +++ b/libclamav/others.c @@ -864,24 +864,19 @@ char *cli_hashstream(FILE *fs, unsigned char *digcpy, int type) char buff[FILEBUFF]; char *hashstr, *pt; int i, bytes, size; - EVP_MD_CTX *ctx; - - ctx = EVP_MD_CTX_create(); - if (!(ctx)) - return NULL; + EVP_MD_CTX ctx; if(type == 1) - EVP_DigestInit(ctx, EVP_md5()); + EVP_DigestInit(&ctx, EVP_md5()); else if(type == 2) - EVP_DigestInit(ctx, EVP_sha1()); + EVP_DigestInit(&ctx, EVP_sha1()); else - EVP_DigestInit(ctx, EVP_sha256()); + EVP_DigestInit(&ctx, EVP_sha256()); while((bytes = fread(buff, 1, FILEBUFF, fs))) - EVP_DigestUpdate(ctx, buff, bytes); + EVP_DigestUpdate(&ctx, buff, bytes); - EVP_DigestFinal(ctx, digest, &size); - EVP_MD_CTX_destroy(ctx); + EVP_DigestFinal(&ctx, digest, &size); if(!(hashstr = (char *) cli_calloc(size*2 + 1, sizeof(char)))) return NULL; diff --git a/libclamav/pe.c b/libclamav/pe.c index ddf2c248c..7521b6d7d 100644 --- a/libclamav/pe.c +++ b/libclamav/pe.c @@ -2800,7 +2800,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin struct cli_exe_section *exe_sections; struct pe_image_data_dir *dirs; fmap_t *map = *ctx->fmap; - EVP_MD_CTX *hashctx; + EVP_MD_CTX hashctx; if (flags & CL_CHECKFP_PE_FLAG_STATS) if (!(hashes)) @@ -2939,13 +2939,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin } } - hashctx = EVP_MD_CTX_create(); - if (!(hashctx)) { - free(exe_sections); - return CL_EMEM; - } - - EVP_DigestInit(hashctx, EVP_sha1()); + EVP_DigestInit(&hashctx, EVP_sha1()); } #define hash_chunk(where, size, isStatAble, section) \ @@ -2957,16 +2951,12 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin return CL_EFORMAT; \ } \ if (flags & CL_CHECKFP_PE_FLAG_AUTHENTICODE) \ - EVP_DigestUpdate(hashctx, hptr, size); \ + EVP_DigestUpdate(&hashctx, hptr, size); \ if (isStatAble && flags & CL_CHECKFP_PE_FLAG_STATS) { \ - EVP_MD_CTX *md5ctx; \ - md5ctx = EVP_MD_CTX_create(); \ - if ((md5ctx)) { \ - EVP_DigestInit(md5ctx, EVP_md5()); \ - EVP_DigestUpdate(md5ctx, hptr, size); \ - EVP_DigestFinal(md5ctx, hashes->sections[section].md5, NULL); \ - EVP_MD_CTX_destroy(md5ctx); \ - } \ + EVP_MD_CTX md5ctx; \ + EVP_DigestInit(&md5ctx, EVP_md5()); \ + EVP_DigestUpdate(&md5ctx, hptr, size); \ + EVP_DigestFinal(&md5ctx, hashes->sections[section].md5, NULL); \ } \ } while(0) @@ -3018,11 +3008,9 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin hlen = fsize - at; if(dirs[4].Size > hlen) { if (flags & CL_CHECKFP_PE_FLAG_STATS) { - EVP_MD_CTX_destroy(hashctx); flags ^= CL_CHECKFP_PE_FLAG_AUTHENTICODE; break; } else { - EVP_MD_CTX_destroy(hashctx); free(exe_sections); return CL_EFORMAT; } @@ -3039,8 +3027,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin free(exe_sections); if (flags & CL_CHECKFP_PE_FLAG_AUTHENTICODE) { - EVP_DigestFinal(hashctx, authsha1, NULL); - EVP_MD_CTX_destroy(hashctx); + EVP_DigestFinal(&hashctx, authsha1, NULL); if(cli_debug_flag) { char shatxt[SHA1_HASH_SIZE*2+1]; diff --git a/libclamav/phishcheck.c b/libclamav/phishcheck.c index d940434e3..f61de913c 100644 --- a/libclamav/phishcheck.c +++ b/libclamav/phishcheck.c @@ -1202,18 +1202,13 @@ static int hash_match(const struct regex_matcher *rlist, const char *host, size_ unsigned char h[65]; unsigned char sha256_dig[32]; unsigned i; - EVP_MD_CTX *sha256; + EVP_MD_CTX sha256; - sha256 = EVP_MD_CTX_create(); - if (!(sha256)) - return CL_SUCCESS; + EVP_DigestInit(&sha256, EVP_sha256()); + EVP_DigestUpdate(&sha256, host, hlen); + EVP_DigestUpdate(&sha256, path, plen); + EVP_DigestFinal(&sha256, sha256_dig, NULL); - EVP_DigestInit(sha256, EVP_sha256()); - EVP_DigestUpdate(sha256, host, hlen); - EVP_DigestUpdate(sha256, path, plen); - EVP_DigestFinal(sha256, sha256_dig, NULL); - - EVP_MD_CTX_destroy(sha256); for(i=0;i<32;i++) { h[2*i] = hexchars[sha256_dig[i]>>4]; h[2*i+1] = hexchars[sha256_dig[i]&0xf]; diff --git a/libclamav/readdb.c b/libclamav/readdb.c index 00f2902d5..c07132ee7 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -420,8 +420,7 @@ char *cli_dbgets(char *buff, unsigned int size, FILE *fs, struct cli_dbio *dbio) dbio->bufpt = dbio->buf; dbio->size -= bread; dbio->bread += bread; - if ((dbio->hashctx)) - EVP_DigestUpdate(dbio->hashctx, dbio->readpt, bread); + EVP_DigestUpdate(&(dbio->hashctx), dbio->readpt, bread); } if(dbio->chkonly && dbio->bufpt) { dbio->bufpt = NULL; @@ -478,8 +477,7 @@ char *cli_dbgets(char *buff, unsigned int size, FILE *fs, struct cli_dbio *dbio) bs = strlen(buff); dbio->size -= bs; dbio->bread += bs; - if ((dbio->hashctx)) - EVP_DigestUpdate(dbio->hashctx, buff, bs); + EVP_DigestUpdate(&(dbio->hashctx), buff, bs); return pt; } } diff --git a/unit_tests/valgrind.supp b/unit_tests/valgrind.supp index 079ffc1fd..61d5ada4f 100644 --- a/unit_tests/valgrind.supp +++ b/unit_tests/valgrind.supp @@ -64,3 +64,13 @@ fun:sendmmsg ... } +{ + openssl-leak-01 + Memcheck:Leak + fun:malloc + ... + fun:CRYPTO_malloc + ... + fun:EVP_DigestInit_ex + ... +} From 5b599af837ab9eee6710079a04ae3bb12d166a86 Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Mon, 10 Feb 2014 11:06:37 -0500 Subject: [PATCH 4/7] Restore LDFLAGS after probing for CURL --- Makefile.in | 1 - clamav-milter/Makefile.in | 1 - clambc/Makefile.in | 1 - clamconf/Makefile.in | 1 - clamd/Makefile.in | 1 - clamdscan/Makefile.in | 1 - clamdtop/Makefile.in | 1 - clamscan/Makefile.in | 1 - clamsubmit/Makefile.in | 1 - configure | 101 +-------------------------------- configure.ac | 1 - database/Makefile.in | 1 - docs/Makefile.in | 1 - etc/Makefile.in | 1 - freshclam/Makefile.in | 1 - libclamav/Makefile.in | 1 - libltdl/Makefile.in | 1 - m4/reorganization/libs/curl.m4 | 1 + shared/Makefile.in | 1 - sigtool/Makefile.in | 1 - test/Makefile.in | 1 - unit_tests/Makefile.in | 1 - 22 files changed, 2 insertions(+), 120 deletions(-) diff --git a/Makefile.in b/Makefile.in index 662802a93..e2cfca57f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -154,7 +154,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clamav-milter/Makefile.in b/clamav-milter/Makefile.in index 6bd39d5ef..1acba57f0 100644 --- a/clamav-milter/Makefile.in +++ b/clamav-milter/Makefile.in @@ -136,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clambc/Makefile.in b/clambc/Makefile.in index df074d35b..815a82184 100644 --- a/clambc/Makefile.in +++ b/clambc/Makefile.in @@ -117,7 +117,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clamconf/Makefile.in b/clamconf/Makefile.in index 021cd2626..4a289c92f 100644 --- a/clamconf/Makefile.in +++ b/clamconf/Makefile.in @@ -135,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clamd/Makefile.in b/clamd/Makefile.in index 6c92e8ddb..02717b5c1 100644 --- a/clamd/Makefile.in +++ b/clamd/Makefile.in @@ -135,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clamdscan/Makefile.in b/clamdscan/Makefile.in index f62392732..ec5d49437 100644 --- a/clamdscan/Makefile.in +++ b/clamdscan/Makefile.in @@ -135,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clamdtop/Makefile.in b/clamdtop/Makefile.in index 351d0e393..fa0f3374b 100644 --- a/clamdtop/Makefile.in +++ b/clamdtop/Makefile.in @@ -117,7 +117,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clamscan/Makefile.in b/clamscan/Makefile.in index 8b96463cf..99f385312 100644 --- a/clamscan/Makefile.in +++ b/clamscan/Makefile.in @@ -136,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/clamsubmit/Makefile.in b/clamsubmit/Makefile.in index ec90fd299..e6aac12e3 100644 --- a/clamsubmit/Makefile.in +++ b/clamsubmit/Makefile.in @@ -135,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/configure b/configure index f27e5867f..6c70992d3 100755 --- a/configure +++ b/configure @@ -903,7 +903,6 @@ enable_distcheck_werror enable_llvm enable_sha_collector_for_internal_use with_libcurl -with_libconfig enable_xml with_xml with_openssl @@ -1609,8 +1608,6 @@ Optional Packages: --without-libpdcurses-prefix don't search for libpdcurses in includedir and libdir --with-libcurl=DIR path to directory containing libcurl (default= /usr/local or /usr if not found in /usr/local) - --with-libconfig=DIR path to directory containing libconfig (default= - /usr/local or /usr if not found in /usr/local) --with-xml=DIR path to directory containing libxml2 library (default= /usr/local or /usr if not found in /usr/local) --with-openssl=DIR path to directory containing openssl (default= @@ -21492,108 +21489,12 @@ else $as_echo "$as_me: WARNING: Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs." >&2;} fi + LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libconfig installation" >&5 -$as_echo_n "checking for libconfig installation... " >&6; } - - -# Check whether --with-libconfig was given. -if test "${with_libconfig+set}" = set; then : - withval=$with_libconfig; -if test "$withval"; then - LIBCONFIG_HOME="$withval" -fi - -else - -LIBCONFIG_HOME=/usr/local -if test ! -f "$LIBCONFIG_HOME/include/libconfig.h" -then - LIBCONFIG_HOME=/usr -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBCONFIG_HOME" >&5 -$as_echo "$LIBCONFIG_HOME" >&6; } - -fi - - -if test ! -f "$LIBCONFIG_HOME/include/libconfig.h" -then - as_fn_error $? "libconfig not found." "$LINENO" 5 -fi - -save_LDFLAGS="$LDFLAGS" -LDFLAGS="-L$LIBCONFIG_HOME/lib -lconfig" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for config_init in -lconfig" >&5 -$as_echo_n "checking for config_init in -lconfig... " >&6; } -if ${ac_cv_lib_config_config_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lconfig $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char config_init (); -int -main () -{ -return config_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_config_config_init=yes -else - ac_cv_lib_config_config_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_config_config_init" >&5 -$as_echo "$ac_cv_lib_config_config_init" >&6; } -if test "x$ac_cv_lib_config_config_init" = xyes; then : - FRESHCLAM_LIBS="$FRESHCLAM_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -else - as_fn_error $? "Your libconfig installation is misconfigured" "$LINENO" 5 -fi - - -CLAMSCAN_LIBS="$CLAMSCAN_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -CLAMDSCAN_LIBS="$CLAMDSCAN_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -CLAMD_LIBS="$CLAMD_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -CLAMMEM_LIBS="$CLAMMEM_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -CLAMDTOP_LIBS="$CLAMDTOP_LIBS -L$LIBCONFIG_HOME/lib -lconfig" -CLAMBC_LIBS="$CLAMBC_LIBS -L$LIBCONFIG_HOME/lib -lconfig" - -CLAMSCAN_CPPFLAGS="$FRESHCLAM_CPPFLAGS -I$LIBCONFIG_HOME/include" -CLAMDSCAN_CPPFLAGS="$CLAMDSCAN_CPPFLAGS -I$LIBCONFIG_HOME/include" -CLAMD_CPPFLAGS="$CLAMD_CPPFLAGS -I$LIBCONFIG_HOME/include" -CLAMMEM_CPPFLAGS="$CLAMMEM_CPPFLAGS -I$LIBCONFIG_HOME/include" -CLAMAV_MILTER_CPPFLAGS="$CLAMAV_MILTER_CPPFLAGS -I$LIBCONFIG_HOME/include" -LIBCLAMAV_CPPFLAGS="$LIBCLAMAV_CPPFLAGS -I$LIBCONFIG_HOME/include" -LIBCLAMSHARED_CPPFLAGS="$LIBCLAMSHARED_CPPFLAGS -I$LIBCONFIG_HOME/include" -SIGTOOL_CPPFLAGS="$SIGTOOL_CPPFLAGS -I$LIBCONFIG_HOME/include" -CLAMCONF_CPPFLAGS="$CLAMCONF_CPPFLAGS -I$LIBCONFIG_HOME/include" -CLAMDTOP_CPPFLAGS="$CLAMDTOP_CPPFLAGS -I$LIBCONFIG_HOME/include" -CLAMBC_CPPFLAGS="$CLAMBC_CPPFLAGS -I$LIBCONFIG_HOME/include" - -LDFLAGS="$save_ldflags" - want_xml="auto" diff --git a/configure.ac b/configure.ac index bb1ed68c5..d96d0ee92 100644 --- a/configure.ac +++ b/configure.ac @@ -122,7 +122,6 @@ m4_include([m4/reorganization/bsd.m4]) dnl Freshclam dependencies m4_include([m4/reorganization/libs/curl.m4]) -m4_include([m4/reorganization/libs/libconfig.m4]) dnl libclamav dependencies m4_include([m4/reorganization/libs/xml.m4]) diff --git a/database/Makefile.in b/database/Makefile.in index f135a4457..934565654 100644 --- a/database/Makefile.in +++ b/database/Makefile.in @@ -134,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/docs/Makefile.in b/docs/Makefile.in index 1dcc21b6c..05dec31b3 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -133,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/etc/Makefile.in b/etc/Makefile.in index c188fa9b9..9500e7381 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -135,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/freshclam/Makefile.in b/freshclam/Makefile.in index 95cc6604f..f1857e8f5 100644 --- a/freshclam/Makefile.in +++ b/freshclam/Makefile.in @@ -136,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/libclamav/Makefile.in b/libclamav/Makefile.in index e664299fb..2de5f20fc 100644 --- a/libclamav/Makefile.in +++ b/libclamav/Makefile.in @@ -146,7 +146,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/libltdl/Makefile.in b/libltdl/Makefile.in index 364b19470..6b9a0232f 100644 --- a/libltdl/Makefile.in +++ b/libltdl/Makefile.in @@ -124,7 +124,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/m4/reorganization/libs/curl.m4 b/m4/reorganization/libs/curl.m4 index 4c413cb71..7a5597e2a 100644 --- a/m4/reorganization/libs/curl.m4 +++ b/m4/reorganization/libs/curl.m4 @@ -34,6 +34,7 @@ else LDFLAGS="-L$LIBCURL_HOME/lib -lcurl" AC_CHECK_LIB([curl], [curl_easy_init], [curl_msg="";have_curl="yes";CLAMSUBMIT_LIBS="$CLAMSUBMIT_LIBS $CURL_LDFLAGS";CLAMSUBMIT_CFLAGS="$CLAMSUBMIT_CFLAGS $CURL_CPPFLAGS"], [AC_MSG_WARN([Your libcurl is misconfigured. Please use the web interface for submitting FPs/FNs.])]) + LDFLAGS="$save_LDFLAGS" fi AC_SUBST([CLAMSUBMIT_LIBS]) diff --git a/shared/Makefile.in b/shared/Makefile.in index 73a3160df..2b8dc7a48 100644 --- a/shared/Makefile.in +++ b/shared/Makefile.in @@ -116,7 +116,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/sigtool/Makefile.in b/sigtool/Makefile.in index 1b6932bfe..1f748f12d 100644 --- a/sigtool/Makefile.in +++ b/sigtool/Makefile.in @@ -135,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/test/Makefile.in b/test/Makefile.in index d175eb36e..0ba2c3fef 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -116,7 +116,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ diff --git a/unit_tests/Makefile.in b/unit_tests/Makefile.in index 8bfa0d492..ced1b133d 100644 --- a/unit_tests/Makefile.in +++ b/unit_tests/Makefile.in @@ -118,7 +118,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ $(top_srcdir)/m4/reorganization/sha_collect.m4 \ $(top_srcdir)/m4/reorganization/bsd.m4 \ $(top_srcdir)/m4/reorganization/libs/curl.m4 \ - $(top_srcdir)/m4/reorganization/libs/libconfig.m4 \ $(top_srcdir)/m4/reorganization/libs/xml.m4 \ $(top_srcdir)/m4/reorganization/libs/openssl.m4 \ $(top_srcdir)/m4/reorganization/substitutions.m4 \ From c7ad4bea8a3d828527bc62def5987c5ba4ba3ee3 Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Tue, 11 Feb 2014 17:11:37 -0500 Subject: [PATCH 5/7] Build on Win32 --- libclamav/7z/7zAlloc.c | 5 + libclamav/7z/7zBuf2.c | 6 + libclamav/7z/7zCrc.c | 5 + libclamav/7z/7zCrcOpt.c | 5 + libclamav/7z/7zDec.c | 5 + libclamav/7z/7zIn.c | 5 + libclamav/7z/CpuArch.c | 5 + libclamav/7z/Xz.c | 5 + libclamav/7z/XzDec.c | 5 + libclamav/7z/XzIn.c | 5 + libclamav/7z_iface.c | 4 + libclamav/json.c | 5 + win32/Setup-x86/Setup-x86.vdproj | 232 +++++++++++++++++++++++------ win32/clambc.vcxproj | 30 ++-- win32/clamconf.vcxproj | 30 ++-- win32/clamd.vcxproj | 48 +++--- win32/clamd.vcxproj.filters | 3 + win32/clamdscan.vcxproj | 40 ++--- win32/clamdscan.vcxproj.filters | 3 + win32/clamscan.vcxproj | 35 +++-- win32/clamscan.vcxproj.filters | 3 - win32/compat/dirent.c | 7 +- win32/compat/w32_stat.c | 4 + win32/freshclam.vcxproj | 58 ++++---- win32/freshclam.vcxproj.filters | 7 + win32/libclamav.def | 27 +++- win32/libclamav.vcxproj | 17 ++- win32/libclamav.vcxproj.filters | 30 ++-- win32/libclamavcxx.vcxproj | 31 ++-- win32/libclamavcxx.vcxproj.filters | 6 + win32/sigtool.vcxproj | 42 +++--- win32/sigtool.vcxproj.filters | 4 + 32 files changed, 493 insertions(+), 224 deletions(-) diff --git a/libclamav/7z/7zAlloc.c b/libclamav/7z/7zAlloc.c index 964b28db3..f280ee245 100644 --- a/libclamav/7z/7zAlloc.c +++ b/libclamav/7z/7zAlloc.c @@ -3,6 +3,11 @@ #include "7zAlloc.h" +#if defined(_WIN32) +#include +#include +#endif + /* #define _SZ_ALLOC_DEBUG */ /* use _SZ_ALLOC_DEBUG to debug alloc/free operations */ diff --git a/libclamav/7z/7zBuf2.c b/libclamav/7z/7zBuf2.c index 8d17e0dcf..a324d048a 100644 --- a/libclamav/7z/7zBuf2.c +++ b/libclamav/7z/7zBuf2.c @@ -2,6 +2,12 @@ 2008-10-04 : Igor Pavlov : Public domain */ #include + +#if defined(_WIN32) +#include +#include +#endif + #include "7zBuf.h" void DynBuf_Construct(CDynBuf *p) diff --git a/libclamav/7z/7zCrc.c b/libclamav/7z/7zCrc.c index 344a43165..30dbf80bf 100644 --- a/libclamav/7z/7zCrc.c +++ b/libclamav/7z/7zCrc.c @@ -1,6 +1,11 @@ /* 7zCrc.c -- CRC32 calculation 2009-11-23 : Igor Pavlov : Public domain */ +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z/7zCrcOpt.c b/libclamav/7z/7zCrcOpt.c index 0d9b2c46c..36e9a6187 100755 --- a/libclamav/7z/7zCrcOpt.c +++ b/libclamav/7z/7zCrcOpt.c @@ -1,6 +1,11 @@ /* 7zCrcOpt.c -- CRC32 calculation : optimized version 2009-11-23 : Igor Pavlov : Public domain */ +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z/7zDec.c b/libclamav/7z/7zDec.c index 7022c4730..ebcff957c 100644 --- a/libclamav/7z/7zDec.c +++ b/libclamav/7z/7zDec.c @@ -3,6 +3,11 @@ #include +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z/7zIn.c b/libclamav/7z/7zIn.c index 3bb0a9a23..d520b6133 100644 --- a/libclamav/7z/7zIn.c +++ b/libclamav/7z/7zIn.c @@ -3,6 +3,11 @@ #include +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z/CpuArch.c b/libclamav/7z/CpuArch.c index e4841ea25..f5411ea7a 100755 --- a/libclamav/7z/CpuArch.c +++ b/libclamav/7z/CpuArch.c @@ -1,6 +1,11 @@ /* CpuArch.c -- CPU specific code 2010-10-26: Igor Pavlov : Public domain */ +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z/Xz.c b/libclamav/7z/Xz.c index cdadfbd4b..13e7b10c1 100755 --- a/libclamav/7z/Xz.c +++ b/libclamav/7z/Xz.c @@ -1,6 +1,11 @@ /* Xz.c - Xz 2009-04-15 : Igor Pavlov : Public domain */ +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z/XzDec.c b/libclamav/7z/XzDec.c index 196a066cb..fd4f11bfe 100755 --- a/libclamav/7z/XzDec.c +++ b/libclamav/7z/XzDec.c @@ -10,6 +10,11 @@ #include #include +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z/XzIn.c b/libclamav/7z/XzIn.c index 5320bd212..a929d9c8a 100755 --- a/libclamav/7z/XzIn.c +++ b/libclamav/7z/XzIn.c @@ -3,6 +3,11 @@ #include +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/libclamav/7z_iface.c b/libclamav/7z_iface.c index 0bea5d503..904591537 100644 --- a/libclamav/7z_iface.c +++ b/libclamav/7z_iface.c @@ -18,6 +18,10 @@ * MA 02110-1301, USA. */ +#if defined(_WIN32) +#include +#include +#endif #include #include diff --git a/libclamav/json.c b/libclamav/json.c index 76de8b448..72425353e 100644 --- a/libclamav/json.c +++ b/libclamav/json.c @@ -29,6 +29,11 @@ #include #include +#if defined(_WIN32) +#include +#include +#endif + #include #include #include "libclamav/crypto.h" diff --git a/win32/Setup-x86/Setup-x86.vdproj b/win32/Setup-x86/Setup-x86.vdproj index 782934de4..97da8c389 100755 --- a/win32/Setup-x86/Setup-x86.vdproj +++ b/win32/Setup-x86/Setup-x86.vdproj @@ -69,134 +69,146 @@ } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_129947045FE24C5AAEE6467547A6FBBB" + "MsmKey" = "8:_4FC55746B30C48D59E9FE8557C108069" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_E6AAF8DB843A4CDCBD12F62B44F0D947" + "MsmKey" = "8:_572E52797C0A4873ACFC45E53ED1FB78" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_C3F868E2F86F4F22914EBB33174331CF" + "MsmKey" = "8:_5C115FFB3D1542998DEB88C97B348F59" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_AA48472048A74261A786515933650C63" + "MsmKey" = "8:_64B5C4E9452F43349FB4D53DEE15C87D" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_86FBE3D4BB5F42609082FB54D8079705" + "MsmKey" = "8:_6D1F45F66466453998A8B163691BAD84" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_64B5C4E9452F43349FB4D53DEE15C87D" + "MsmKey" = "8:_6E6776606E994FD99CC36CB5C62935CF" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_42222ACB125B4398B7BF9C030F7DF8FB" + "MsmKey" = "8:_70FC345C7A6C47D799FD1EC7CD5F20D9" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_4053CC7DC75C48E98893BCEA2D692E55" + "MsmKey" = "8:_86FBE3D4BB5F42609082FB54D8079705" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_32F4158C158142089DB13F5F29F91589" + "MsmKey" = "8:_893ED45A96044D8B94FDF0BF5DD2476B" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_59DC2980739C4FDAA8EC96CD313429EF" - "OwnerKey" = "8:_29583B2B37A44A71864FFD88DFED2C8F" + "MsmKey" = "8:_9365183139E941EA8C13A61D5EA82D2C" + "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_5C115FFB3D1542998DEB88C97B348F59" + "MsmKey" = "8:_AA48472048A74261A786515933650C63" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_64B5C4E9452F43349FB4D53DEE15C87D" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_B15174FB733CFDB87929A99EF031FE60" + "OwnerKey" = "8:_29583B2B37A44A71864FFD88DFED2C8F" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_6D1F45F66466453998A8B163691BAD84" + "MsmKey" = "8:_C3F868E2F86F4F22914EBB33174331CF" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_6E6776606E994FD99CC36CB5C62935CF" + "MsmKey" = "8:_C53272351C914F09989E6CB992D9BE44" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_70FC345C7A6C47D799FD1EC7CD5F20D9" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_129947045FE24C5AAEE6467547A6FBBB" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_86FBE3D4BB5F42609082FB54D8079705" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_E6AAF8DB843A4CDCBD12F62B44F0D947" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_893ED45A96044D8B94FDF0BF5DD2476B" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_C3F868E2F86F4F22914EBB33174331CF" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_9365183139E941EA8C13A61D5EA82D2C" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_AA48472048A74261A786515933650C63" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_AA48472048A74261A786515933650C63" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_86FBE3D4BB5F42609082FB54D8079705" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_B15174FB733CFDB87929A99EF031FE60" - "OwnerKey" = "8:_29583B2B37A44A71864FFD88DFED2C8F" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_64B5C4E9452F43349FB4D53DEE15C87D" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_C3F868E2F86F4F22914EBB33174331CF" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_42222ACB125B4398B7BF9C030F7DF8FB" "MsmSig" = "8:_UNDEFINED" } "Entry" { - "MsmKey" = "8:_C53272351C914F09989E6CB992D9BE44" - "OwnerKey" = "8:_UNDEFINED" + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_4053CC7DC75C48E98893BCEA2D692E55" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_32F4158C158142089DB13F5F29F91589" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_E26F0CDAA61C437B9CC7EF502F84731E" + "OwnerKey" = "8:_29583B2B37A44A71864FFD88DFED2C8F" "MsmSig" = "8:_UNDEFINED" } "Entry" @@ -223,6 +235,66 @@ "OwnerKey" = "8:_42222ACB125B4398B7BF9C030F7DF8FB" "MsmSig" = "8:_UNDEFINED" } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_129947045FE24C5AAEE6467547A6FBBB" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_E6AAF8DB843A4CDCBD12F62B44F0D947" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_C3F868E2F86F4F22914EBB33174331CF" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_AA48472048A74261A786515933650C63" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_86FBE3D4BB5F42609082FB54D8079705" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_64B5C4E9452F43349FB4D53DEE15C87D" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_42222ACB125B4398B7BF9C030F7DF8FB" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_4053CC7DC75C48E98893BCEA2D692E55" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_32F4158C158142089DB13F5F29F91589" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_29583B2B37A44A71864FFD88DFED2C8F" + "MsmSig" = "8:_UNDEFINED" + } } "Configurations" { @@ -248,6 +320,19 @@ "PrerequisitesLocation" = "2:1" "Url" = "8:" "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0,Profile=Client" + { + "Name" = "8:Microsoft .NET Framework 4 Client Profile (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0,Profile=Client" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } } } "Release" @@ -272,6 +357,19 @@ "PrerequisitesLocation" = "2:1" "Url" = "8:" "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0,Profile=Client" + { + "Name" = "8:Microsoft .NET Framework 4 Client Profile (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.0,Profile=Client" + } + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.3.1" + { + "Name" = "8:Windows Installer 3.1" + "ProductCode" = "8:Microsoft.Windows.Installer.3.1" + } + } } } } @@ -290,6 +388,14 @@ { "LaunchCondition" { + "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_C692B08A77FF4D50B94635F349068667" + { + "Name" = "8:.NET Framework" + "Message" = "8:[VSDNETMSG]" + "FrameworkVersion" = "8:.NETFramework,Version=v4.0,Profile=Client" + "AllowLaterVersions" = "11:FALSE" + "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000" + } } } "File" @@ -374,6 +480,46 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4FC55746B30C48D59E9FE8557C108069" + { + "SourcePath" = "8:C:\\clamdeps\\win32\\openssl\\lib\\ssleay32.dll" + "TargetName" = "8:ssleay32.dll" + "Tag" = "8:" + "Folder" = "8:_C751D6577C584B05A32BF01390F14B9F" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_572E52797C0A4873ACFC45E53ED1FB78" + { + "SourcePath" = "8:C:\\clamdeps\\win32\\openssl\\lib\\libeay32.dll" + "TargetName" = "8:libeay32.dll" + "Tag" = "8:" + "Folder" = "8:_C751D6577C584B05A32BF01390F14B9F" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_5C115FFB3D1542998DEB88C97B348F59" { "SourcePath" = "8:..\\..\\COPYING.unrar" @@ -651,7 +797,7 @@ "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:ClamAV" "ProductCode" = "8:{088E38E4-6B8C-4603-8AB2-1E0762440E11}" - "PackageCode" = "8:{BD0C7A7A-99CC-4995-9B9C-CEFDD48B9A47}" + "PackageCode" = "8:{9A34A1A1-9677-44FC-BC23-3B168131B094}" "UpgradeCode" = "8:{B65ED295-87F7-4870-8017-E3A594DDADF8}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" @@ -1167,7 +1313,7 @@ } "MergeModule" { - "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_59DC2980739C4FDAA8EC96CD313429EF" + "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_E26F0CDAA61C437B9CC7EF502F84731E" { "UseDynamicProperties" = "11:TRUE" "IsDependency" = "11:TRUE" diff --git a/win32/clambc.vcxproj b/win32/clambc.vcxproj index e0cb1e773..a9524dff4 100644 --- a/win32/clambc.vcxproj +++ b/win32/clambc.vcxproj @@ -1,5 +1,4 @@ - - + @@ -24,7 +23,7 @@ Win32Proj clambc - + Application true @@ -47,22 +46,22 @@ true MultiByte - + - + - + - + - + - + true $(SolutionDir)build\$(PlatformName)\$(ProjectName)\$(Configuration)\ @@ -89,13 +88,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 Console true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -152,18 +152,18 @@ - - + + - + {09d341e9-7372-46e9-b0d7-caaf77984190} - + - + \ No newline at end of file diff --git a/win32/clamconf.vcxproj b/win32/clamconf.vcxproj index 4b92d1e50..be863d289 100644 --- a/win32/clamconf.vcxproj +++ b/win32/clamconf.vcxproj @@ -1,5 +1,4 @@ - - + @@ -24,7 +23,7 @@ Win32Proj clamconf - + Application true @@ -47,22 +46,22 @@ true MultiByte - + - + - + - + - + - + true $(SolutionDir)build\$(PlatformName)\$(ProjectName)\$(Configuration)\ @@ -89,13 +88,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 Console true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -152,18 +152,18 @@ - - + + - + {09d341e9-7372-46e9-b0d7-caaf77984190} - + - + \ No newline at end of file diff --git a/win32/clamd.vcxproj b/win32/clamd.vcxproj index 6035b4f44..a02318731 100644 --- a/win32/clamd.vcxproj +++ b/win32/clamd.vcxproj @@ -1,5 +1,4 @@ - - + @@ -24,7 +23,7 @@ Win32Proj clamd - + Application true @@ -47,22 +46,22 @@ true MultiByte - + - + - + - + - + - + true $(SolutionDir)build\$(PlatformName)\$(ProjectName)\$(Configuration)\ @@ -89,13 +88,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244;4090;4018;4101 Console true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -152,27 +152,27 @@ - + - - - - - - - - - - - + + + + + + + + + + + {09d341e9-7372-46e9-b0d7-caaf77984190} - + - + \ No newline at end of file diff --git a/win32/clamd.vcxproj.filters b/win32/clamd.vcxproj.filters index cf6a768f2..39fa0b618 100644 --- a/win32/clamd.vcxproj.filters +++ b/win32/clamd.vcxproj.filters @@ -49,5 +49,8 @@ Source Files\shared + + Source Files + \ No newline at end of file diff --git a/win32/clamdscan.vcxproj b/win32/clamdscan.vcxproj index 5a3bc56b0..11220e986 100644 --- a/win32/clamdscan.vcxproj +++ b/win32/clamdscan.vcxproj @@ -1,5 +1,4 @@ - - + @@ -24,7 +23,7 @@ Win32Proj clamdscan - + Application true @@ -47,22 +46,22 @@ true MultiByte - + - + - + - + - + - + true $(SolutionDir)build\$(PlatformName)\$(ProjectName)\$(Configuration)\ @@ -89,13 +88,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 Console true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -152,23 +152,23 @@ - + - - - - - - - + + + + + + + {09d341e9-7372-46e9-b0d7-caaf77984190} - + - + \ No newline at end of file diff --git a/win32/clamdscan.vcxproj.filters b/win32/clamdscan.vcxproj.filters index 402d80b0c..bd9b14bf8 100644 --- a/win32/clamdscan.vcxproj.filters +++ b/win32/clamdscan.vcxproj.filters @@ -37,5 +37,8 @@ Source Files\shared + + Source Files + \ No newline at end of file diff --git a/win32/clamscan.vcxproj b/win32/clamscan.vcxproj index ae4bf8ef2..f0474328b 100644 --- a/win32/clamscan.vcxproj +++ b/win32/clamscan.vcxproj @@ -1,5 +1,4 @@ - - + @@ -24,7 +23,7 @@ Win32Proj clamscan - + Application true @@ -47,22 +46,22 @@ true MultiByte - + - + - + - + - + - + true $(SolutionDir)build\$(PlatformName)\$(ProjectName)\$(Configuration)\ @@ -89,7 +88,7 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 @@ -152,21 +151,21 @@ - + - - - - - + + + + + {09d341e9-7372-46e9-b0d7-caaf77984190} - + - + \ No newline at end of file diff --git a/win32/clamscan.vcxproj.filters b/win32/clamscan.vcxproj.filters index d514669b3..91284702c 100644 --- a/win32/clamscan.vcxproj.filters +++ b/win32/clamscan.vcxproj.filters @@ -19,9 +19,6 @@ - - Source Files - Source Files diff --git a/win32/compat/dirent.c b/win32/compat/dirent.c index 97f9cf601..060b51d4c 100644 --- a/win32/compat/dirent.c +++ b/win32/compat/dirent.c @@ -19,6 +19,11 @@ */ #include + +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "dirent.h" #include "w32_stat.h" @@ -100,4 +105,4 @@ int closedir(DIR *dirp) { rewinddir(dirp); free(dirp); return 0; -} \ No newline at end of file +} diff --git a/win32/compat/w32_stat.c b/win32/compat/w32_stat.c index 75b5fd058..7405f7eef 100644 --- a/win32/compat/w32_stat.c +++ b/win32/compat/w32_stat.c @@ -24,6 +24,10 @@ #include #include +#include +#include +#include "libclamav/crypto.h" + #include "others.h" #include "shared/misc.h" diff --git a/win32/freshclam.vcxproj b/win32/freshclam.vcxproj index c44c1470d..62b7c5109 100644 --- a/win32/freshclam.vcxproj +++ b/win32/freshclam.vcxproj @@ -1,5 +1,4 @@ - - + @@ -24,7 +23,7 @@ Win32Proj freshclam - + Application true @@ -47,22 +46,22 @@ true MultiByte - + - + - + - + - + - + true $(SolutionDir)build\$(PlatformName)\$(ProjectName)\$(Configuration)\ @@ -89,7 +88,7 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244;4101;4102;4018 @@ -97,6 +96,7 @@ Console true dnsapi.lib;%(AdditionalDependencies) + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -156,30 +156,34 @@ - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + {09d341e9-7372-46e9-b0d7-caaf77984190} - + - + + + + + \ No newline at end of file diff --git a/win32/freshclam.vcxproj.filters b/win32/freshclam.vcxproj.filters index b9128f627..ae184b386 100644 --- a/win32/freshclam.vcxproj.filters +++ b/win32/freshclam.vcxproj.filters @@ -61,5 +61,12 @@ Source Files\compat + + Source Files + + + + + \ No newline at end of file diff --git a/win32/libclamav.def b/win32/libclamav.def index 16c1b2fc1..93a80ea60 100644 --- a/win32/libclamav.def +++ b/win32/libclamav.def @@ -51,7 +51,25 @@ EXPORTS cl_engine_set_clcb_stats_flush @43 EXPORTS cl_engine_set_clcb_stats_get_num @44 EXPORTS cl_engine_set_clcb_stats_get_size @45 EXPORTS cl_engine_set_clcb_stats_get_hostid @46 - +EXPORTS cl_hash_data @47 +EXPORTS cl_initialize_crypto @48 +EXPORTS cl_cleanup_crypto @49 +EXPORTS cl_hash_file_fd @50 +EXPORTS cl_hash_file_fp @51 +EXPORTS cl_sha256 @52 +EXPORTS cl_sha1 @53 +EXPORTS cl_verify_signature @54 +EXPORTS cl_verify_signature_x509_keyfile @55 +EXPORTS cl_verify_signature_x509 @56 +EXPORTS cl_sign_data_keyfile @57 +EXPORTS cl_sign_data @58 +EXPORTS cl_sign_file_fd @59 +EXPORTS cl_sign_file_fp @60 +EXPORTS cl_get_x509_from_mem @61 +EXPORTS cl_validate_certificate_chain @62 +EXPORTS cl_load_cert @63 +EXPORTS cl_ASN1_GetTimeT @64 +EXPORTS cl_load_crl @65 ; path variables ; -------------- @@ -150,13 +168,6 @@ EXPORTS readdir @44273 NONAME EXPORTS closedir @44274 NONAME EXPORTS safe_open @44275 NONAME EXPORTS snprintf @44276 NONAME -; SHA1 numbers reused from mp_* functions -EXPORTS SHA1Init @44277 NONAME -EXPORTS SHA1Update @44278 NONAME -EXPORTS SHA1Final @44279 NONAME -EXPORTS sha256_init @44280 NONAME -EXPORTS sha256_update @44281 NONAME -EXPORTS sha256_final @44282 NONAME EXPORTS optget @44283 NONAME EXPORTS optparse @44284 NONAME EXPORTS optfree @44285 NONAME diff --git a/win32/libclamav.vcxproj b/win32/libclamav.vcxproj index 20f1d42d0..f250e7e00 100644 --- a/win32/libclamav.vcxproj +++ b/win32/libclamav.vcxproj @@ -88,7 +88,7 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCLAMAV_EXPORTS;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir).. + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4090;4244;4018;4101;4333;4146 @@ -97,6 +97,7 @@ true ws2_32.lib;%(AdditionalDependencies) $(SolutionDir)libclamav.def + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -173,6 +174,8 @@ + + @@ -276,7 +279,6 @@ - @@ -341,7 +343,6 @@ - @@ -372,7 +373,6 @@ - @@ -472,6 +472,7 @@ + @@ -494,6 +495,8 @@ + + @@ -502,4 +505,8 @@ - + + + + + \ No newline at end of file diff --git a/win32/libclamav.vcxproj.filters b/win32/libclamav.vcxproj.filters index a6d745595..ce63d990d 100644 --- a/win32/libclamav.vcxproj.filters +++ b/win32/libclamav.vcxproj.filters @@ -174,9 +174,6 @@ Source Files - - Source Files - Source Files @@ -294,9 +291,6 @@ Source Files - - Source Files - Source Files\zlib @@ -486,9 +480,6 @@ Source Files - - Source Files - Source Files @@ -888,6 +879,15 @@ Source Files + + Source Files + + + Source Files + + + Source Files\compat + @@ -902,5 +902,15 @@ Source Files + + Source Files + + + Source Files + + + + + - + \ No newline at end of file diff --git a/win32/libclamavcxx.vcxproj b/win32/libclamavcxx.vcxproj index 25e524102..c2f18c853 100644 --- a/win32/libclamavcxx.vcxproj +++ b/win32/libclamavcxx.vcxproj @@ -1,5 +1,4 @@ - - + @@ -20,17 +19,17 @@ - - - - + + + + {3AE8051D-A188-4B11-95A4-14B8F0C290CB} Win32Proj libclamavcxx - + StaticLibrary true @@ -53,22 +52,22 @@ true MultiByte - + - + - + - + - + - + $(SolutionDir)build\$(PlatformName)\$(ProjectName)\$(Configuration)\ $(SolutionDir)$(PlatformName)\$(Configuration)\ @@ -91,7 +90,7 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav\c++\llvm\include";"$(SolutionDir)llvmbuild\include";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)..";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\zlib" + $(SolutionDir);$(SolutionDir)..\libclamav\c++\llvm\include;$(SolutionDir)llvmbuild\include;$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)..;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\zlib;C:\clamdeps\win32\openssl\include CompileAsCpp 4146;4800;4244;4996;4355 @@ -153,7 +152,7 @@ true - + - + \ No newline at end of file diff --git a/win32/libclamavcxx.vcxproj.filters b/win32/libclamavcxx.vcxproj.filters index 714a1c43a..fe4fc47fd 100644 --- a/win32/libclamavcxx.vcxproj.filters +++ b/win32/libclamavcxx.vcxproj.filters @@ -13,5 +13,11 @@ Source Files + + Source Files + + + Source Files + \ No newline at end of file diff --git a/win32/sigtool.vcxproj b/win32/sigtool.vcxproj index 211bab7e6..56b6e27d0 100644 --- a/win32/sigtool.vcxproj +++ b/win32/sigtool.vcxproj @@ -1,5 +1,4 @@ - - + @@ -24,7 +23,7 @@ Win32Proj sigtool - + Application true @@ -47,22 +46,22 @@ true MultiByte - + - + - + - + - + - + true $(SolutionDir)$(PlatformName)\$(Configuration)\ @@ -89,13 +88,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4101;4244;4018 Console true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -152,22 +152,26 @@ - + - - - - - - + + + + + + {09d341e9-7372-46e9-b0d7-caaf77984190} - + - + + + + + \ No newline at end of file diff --git a/win32/sigtool.vcxproj.filters b/win32/sigtool.vcxproj.filters index f609250ea..929787c5c 100644 --- a/win32/sigtool.vcxproj.filters +++ b/win32/sigtool.vcxproj.filters @@ -38,4 +38,8 @@ Source Files\shared + + + + \ No newline at end of file From 1218187d183c42d22a1882105bd7ba53cfc3c6ce Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Wed, 12 Feb 2014 12:43:20 -0500 Subject: [PATCH 6/7] Add OpenSSL linkage to Win64 builds. --- win32/Setup-x64/Setup-x64.vdproj | 162 +++++++++++++++---------------- win32/clambc.vcxproj | 9 +- win32/clamconf.vcxproj | 9 +- win32/clamd.vcxproj | 9 +- win32/clamdscan.vcxproj | 9 +- win32/clamscan.vcxproj | 9 +- win32/freshclam.vcxproj | 9 +- win32/libclamav.vcxproj | 9 +- win32/libclamavcxx.vcxproj | 6 +- win32/sigtool.vcxproj | 13 ++- 10 files changed, 131 insertions(+), 113 deletions(-) diff --git a/win32/Setup-x64/Setup-x64.vdproj b/win32/Setup-x64/Setup-x64.vdproj index 777db8dc7..6a5f84076 100755 --- a/win32/Setup-x64/Setup-x64.vdproj +++ b/win32/Setup-x64/Setup-x64.vdproj @@ -63,6 +63,12 @@ } "Entry" { + "MsmKey" = "8:_65072ADBBB5441898759117DB2AC41EF" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_65C31C39B3E443C4B6EBE65247933F5E" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -117,66 +123,6 @@ } "Entry" { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_DF09DF52E5014B378FBA8B4CD6C11C3B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_65C31C39B3E443C4B6EBE65247933F5E" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_C0DFAFFC11514B9190D3A585C3E58832" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_804379F8A48A4F7DBB50D72302559297" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_71984994A7494BE2965C585DB3EBED1F" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_335D34A6BB624E7190CFE4E63CD398E8" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_EB8D0E3AFBC24F9B9845F08708803C2B" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_FEDD087CC8B64ED3A476664BC5FCAF59" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_F047B3505FC74D809FB8251423DF4095" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_98634933490744AE8DEB5C5DBDC6FE40" - "OwnerKey" = "8:_5CED7DA1BD104DA5AF2882D6CBA6E313" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { "MsmKey" = "8:_9F0AEFC1E1534D2DAA90E7632ACBD869" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -219,6 +165,12 @@ } "Entry" { + "MsmKey" = "8:_FD5044813135497E957CD988624A985F" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_FEDD087CC8B64ED3A476664BC5FCAF59" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -241,6 +193,14 @@ "PrivateKeyFile" = "8:" "TimeStampServer" = "8:" "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + } } "Release" { @@ -257,6 +217,14 @@ "PrivateKeyFile" = "8:" "TimeStampServer" = "8:" "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + } } } "Deployable" @@ -398,6 +366,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_65072ADBBB5441898759117DB2AC41EF" + { + "SourcePath" = "8:C:\\clamdeps\\win64\\openssl\\lib\\libeay32.dll" + "TargetName" = "8:libeay32.dll" + "Tag" = "8:" + "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_671D69A7B15349CF8AE7C0075C51AF53" { "SourcePath" = "8:..\\..\\COPYING.regex" @@ -578,6 +566,26 @@ "IsDependency" = "11:TRUE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_FD5044813135497E957CD988624A985F" + { + "SourcePath" = "8:C:\\clamdeps\\win64\\openssl\\lib\\ssleay32.dll" + "TargetName" = "8:ssleay32.dll" + "Tag" = "8:" + "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } } "FileType" { @@ -1151,26 +1159,12 @@ } "MergeModule" { - "{CEE29DC0-9FBA-4B99-8D47-5BC643D9B626}:_98634933490744AE8DEB5C5DBDC6FE40" - { - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:TRUE" - "SourcePath" = "8:Microsoft_VC100_DebugCRT_x64.msm" - "Properties" - { - } - "LanguageId" = "3:0" - "Exclude" = "11:FALSE" - "Folder" = "8:" - "Feature" = "8:" - "IsolateTo" = "8:" - } } "ProjectOutput" { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_335D34A6BB624E7190CFE4E63CD398E8" { - "SourcePath" = "8:..\\x64\\Debug\\freshclam.exe" + "SourcePath" = "8:..\\Win32\\Release\\freshclam.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1198,7 +1192,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_5CED7DA1BD104DA5AF2882D6CBA6E313" { - "SourcePath" = "8:..\\x64\\Debug\\clamconf.exe" + "SourcePath" = "8:..\\Win32\\Release\\clamconf.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1226,7 +1220,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_65C31C39B3E443C4B6EBE65247933F5E" { - "SourcePath" = "8:..\\x64\\Debug\\sigtool.exe" + "SourcePath" = "8:..\\Win32\\Release\\sigtool.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1254,7 +1248,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_71984994A7494BE2965C585DB3EBED1F" { - "SourcePath" = "8:..\\x64\\Debug\\libclamav.dll" + "SourcePath" = "8:..\\Win32\\Release\\libclamav.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1282,7 +1276,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_804379F8A48A4F7DBB50D72302559297" { - "SourcePath" = "8:..\\x64\\Debug\\libclamunrar.dll" + "SourcePath" = "8:..\\Win32\\Release\\libclamunrar.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1310,7 +1304,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_C0DFAFFC11514B9190D3A585C3E58832" { - "SourcePath" = "8:..\\x64\\Debug\\libclamunrar_iface.dll" + "SourcePath" = "8:..\\Win32\\Release\\libclamunrar_iface.dll" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1338,7 +1332,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_DF09DF52E5014B378FBA8B4CD6C11C3B" { - "SourcePath" = "8:..\\x64\\Debug\\clambc.exe" + "SourcePath" = "8:..\\Win32\\Release\\clambc.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1366,7 +1360,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_EB8D0E3AFBC24F9B9845F08708803C2B" { - "SourcePath" = "8:..\\x64\\Debug\\clamscan.exe" + "SourcePath" = "8:..\\Win32\\Release\\clamscan.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1394,7 +1388,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_F047B3505FC74D809FB8251423DF4095" { - "SourcePath" = "8:..\\x64\\Debug\\clamd.exe" + "SourcePath" = "8:..\\Win32\\Release\\clamd.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" @@ -1422,7 +1416,7 @@ } "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_FEDD087CC8B64ED3A476664BC5FCAF59" { - "SourcePath" = "8:..\\x64\\Debug\\clamdscan.exe" + "SourcePath" = "8:..\\Win32\\Release\\clamdscan.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_CEC880DBF61041CCA0B367A8647B2589" diff --git a/win32/clambc.vcxproj b/win32/clambc.vcxproj index a9524dff4..50fc3c3b2 100644 --- a/win32/clambc.vcxproj +++ b/win32/clambc.vcxproj @@ -104,13 +104,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 Console true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -121,7 +122,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 @@ -130,6 +131,7 @@ true true true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -140,7 +142,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 @@ -149,6 +151,7 @@ true true true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) diff --git a/win32/clamconf.vcxproj b/win32/clamconf.vcxproj index be863d289..bb42d497a 100644 --- a/win32/clamconf.vcxproj +++ b/win32/clamconf.vcxproj @@ -104,13 +104,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 Console true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -121,7 +122,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 @@ -130,6 +131,7 @@ true true true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -140,7 +142,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 @@ -149,6 +151,7 @@ true true true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) diff --git a/win32/clamd.vcxproj b/win32/clamd.vcxproj index a02318731..5519a6870 100644 --- a/win32/clamd.vcxproj +++ b/win32/clamd.vcxproj @@ -104,13 +104,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4090;4018;4101;4267 Console true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -121,7 +122,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244;4090;4018;4101 @@ -130,6 +131,7 @@ true true true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -140,7 +142,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4090;4018;4101;4267 @@ -149,6 +151,7 @@ true true true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) diff --git a/win32/clamdscan.vcxproj b/win32/clamdscan.vcxproj index 11220e986..744ee9fc0 100644 --- a/win32/clamdscan.vcxproj +++ b/win32/clamdscan.vcxproj @@ -104,13 +104,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 Console true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -121,7 +122,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 @@ -130,6 +131,7 @@ true true true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -140,7 +142,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 @@ -149,6 +151,7 @@ true true true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) diff --git a/win32/clamscan.vcxproj b/win32/clamscan.vcxproj index f0474328b..32936c140 100644 --- a/win32/clamscan.vcxproj +++ b/win32/clamscan.vcxproj @@ -103,13 +103,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 Console true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -120,7 +121,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244 @@ -129,6 +130,7 @@ true true true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -139,7 +141,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4267 @@ -148,6 +150,7 @@ true true true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) diff --git a/win32/freshclam.vcxproj b/win32/freshclam.vcxproj index 62b7c5109..a3cc242e7 100644 --- a/win32/freshclam.vcxproj +++ b/win32/freshclam.vcxproj @@ -105,7 +105,7 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4101;4102;4018;4267 @@ -113,6 +113,7 @@ Console true dnsapi.lib;%(AdditionalDependencies) + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -123,7 +124,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4244;4101;4102;4018 @@ -133,6 +134,7 @@ true true dnsapi.lib;%(AdditionalDependencies) + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -143,7 +145,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4244;4101;4102;4018;4267 @@ -153,6 +155,7 @@ true true dnsapi.lib;%(AdditionalDependencies) + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) diff --git a/win32/libclamav.vcxproj b/win32/libclamav.vcxproj index f250e7e00..32bf2c798 100644 --- a/win32/libclamav.vcxproj +++ b/win32/libclamav.vcxproj @@ -106,7 +106,7 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV;WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCLAMAV_EXPORTS;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir).. + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4090;4244;4018;4101;4333;4146;4267;4334 @@ -115,6 +115,7 @@ true ws2_32.lib;%(AdditionalDependencies) $(SolutionDir)libclamav.def + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -125,7 +126,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCLAMAV_EXPORTS;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir).. + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4090;4244;4018;4101;4333;4146 @@ -136,6 +137,7 @@ true ws2_32.lib;%(AdditionalDependencies) $(SolutionDir)libclamav.def + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -146,7 +148,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;PTW32_STATIC_LIB;THIS_IS_LIBCLAMAV;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCLAMAV_EXPORTS;%(PreprocessorDefinitions) - $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir).. + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)3rdparty\libxml2;$(SolutionDir)3rdparty\libxml2\include;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4090;4244;4018;4101;4333;4146;4267;4334 @@ -157,6 +159,7 @@ true ws2_32.lib;%(AdditionalDependencies) $(SolutionDir)libclamav.def + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) diff --git a/win32/libclamavcxx.vcxproj b/win32/libclamavcxx.vcxproj index c2f18c853..01a1fb7d5 100644 --- a/win32/libclamavcxx.vcxproj +++ b/win32/libclamavcxx.vcxproj @@ -105,7 +105,7 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav\c++\llvm\include";"$(SolutionDir)llvmbuild\include";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)..";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\zlib" + $(SolutionDir);$(SolutionDir)..\libclamav\c++\llvm\include;$(SolutionDir)llvmbuild\include;$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)..;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\zlib;C:\clamdeps\win64\openssl\include CompileAsCpp 4146;4800;4244;4996;4355;4267 @@ -122,7 +122,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav\c++\llvm\include";"$(SolutionDir)llvmbuild\include";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)..";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\zlib" + $(SolutionDir);$(SolutionDir)..\libclamav\c++\llvm\include;$(SolutionDir)llvmbuild\include;$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)..;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\zlib;C:\clamdeps\win32\openssl\include CompileAsCpp 4146;4800;4244;4996;4355 @@ -141,7 +141,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav\c++\llvm\include";"$(SolutionDir)llvmbuild\include";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)..";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\zlib" + $(SolutionDir);$(SolutionDir)..\libclamav\c++\llvm\include;$(SolutionDir)llvmbuild\include;$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)..;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\zlib;C:\clamdeps\win64\openssl\include CompileAsCpp 4146;4800;4244;4996;4355;4267 diff --git a/win32/sigtool.vcxproj b/win32/sigtool.vcxproj index 56b6e27d0..7e3b6ece9 100644 --- a/win32/sigtool.vcxproj +++ b/win32/sigtool.vcxproj @@ -104,13 +104,14 @@ Level3 Disabled WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4101;4244;4018;4267 Console true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -121,7 +122,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win32\openssl\include CompileAsC 4996;4101;4244;4018 @@ -130,6 +131,7 @@ true true true + C:\clamdeps\win32\openssl\lib;%(AdditionalLibraryDirectories) @@ -140,7 +142,7 @@ true true WIN32_LEAN_AND_MEAN;HAVE_CONFIG_H;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - "$(SolutionDir)";"$(SolutionDir)..\libclamav";"$(SolutionDir)compat";"$(SolutionDir)3rdparty\zlib";"$(SolutionDir)3rdparty\pthreads";"$(SolutionDir)3rdparty\bzip2";"$(SolutionDir).." + $(SolutionDir);$(SolutionDir)..\libclamav;$(SolutionDir)compat;$(SolutionDir)3rdparty\zlib;$(SolutionDir)3rdparty\pthreads;$(SolutionDir)3rdparty\bzip2;$(SolutionDir)..;C:\clamdeps\win64\openssl\include CompileAsC 4996;4101;4244;4018;4267 @@ -149,6 +151,7 @@ true true true + C:\clamdeps\win64\openssl\lib;%(AdditionalLibraryDirectories) @@ -171,7 +174,7 @@ - - + + \ No newline at end of file From a1cbd793f30444b2d9fc33d66dfb5daeb01adf18 Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Wed, 12 Feb 2014 17:42:48 -0500 Subject: [PATCH 7/7] Fix all memory leaks introduce by OpenSSL backport. --- libclamav/7z/Xz.c | 1 + libclamav/7z/XzDec.c | 2 ++ libclamav/asn1.c | 3 +++ libclamav/cache.c | 1 + libclamav/crypto.c | 4 ++++ libclamav/cvd.c | 19 +++++++++++++++++-- libclamav/cvd.h | 2 +- libclamav/dsig.c | 2 ++ libclamav/hostid.c | 1 + libclamav/matcher.c | 31 +++++++++++++++++++++++++++---- libclamav/others.c | 1 + libclamav/pe.c | 9 +++++++-- libclamav/phishcheck.c | 1 + libclamav/readdb.c | 6 ++++-- libclamav/xar.c | 1 + unit_tests/valgrind.supp | 10 ---------- 16 files changed, 73 insertions(+), 21 deletions(-) diff --git a/libclamav/7z/Xz.c b/libclamav/7z/Xz.c index 13e7b10c1..15704dc85 100755 --- a/libclamav/7z/Xz.c +++ b/libclamav/7z/Xz.c @@ -89,6 +89,7 @@ int XzCheck_Final(CXzCheck *p, Byte *digest) } case XZ_CHECK_SHA256: EVP_DigestFinal(&p->sha, digest, NULL); + EVP_MD_CTX_cleanup(&(p->sha)); break; default: return 0; diff --git a/libclamav/7z/XzDec.c b/libclamav/7z/XzDec.c index fd4f11bfe..ca57adf09 100755 --- a/libclamav/7z/XzDec.c +++ b/libclamav/7z/XzDec.c @@ -706,6 +706,7 @@ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, p->indexPos = p->indexPreSize; p->indexSize += p->indexPreSize; EVP_DigestFinal(&p->sha, p->shaDigest, NULL); + EVP_MD_CTX_cleanup(&p->sha); EVP_DigestInit(&p->sha, EVP_sha256()); p->crc = CrcUpdate(CRC_INIT_VAL, p->buf, p->indexPreSize); p->state = XZ_STATE_STREAM_INDEX; @@ -806,6 +807,7 @@ SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen, p->indexSize += 4; p->pos = 0; EVP_DigestFinal(&p->sha, digest, NULL); + EVP_MD_CTX_cleanup(&p->sha); if (memcmp(digest, p->shaDigest, SHA256_DIGEST_SIZE) != 0) return SZ_ERROR_CRC; } diff --git a/libclamav/asn1.c b/libclamav/asn1.c index 7655ade6d..224865e99 100644 --- a/libclamav/asn1.c +++ b/libclamav/asn1.c @@ -1025,6 +1025,7 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg EVP_DigestUpdate(&ctx, "\x31", 1); EVP_DigestUpdate(&ctx, attrs + 1, attrs_size - 1); EVP_DigestFinal(&ctx, sha1, NULL); + EVP_MD_CTX_cleanup(&ctx); if(!fmap_need_ptr_once(map, asn1.content, asn1.size)) { cli_dbgmsg("asn1_parse_mscat: failed to read encryptedDigest\n"); @@ -1266,11 +1267,13 @@ static int asn1_parse_mscat(fmap_t *map, size_t offset, unsigned int size, crtmg EVP_DigestUpdate(&ctx, "\x31", 1); EVP_DigestUpdate(&ctx, attrs + 1, attrs_size - 1); EVP_DigestFinal(&ctx, sha1, NULL); + EVP_MD_CTX_cleanup(&ctx); } else { EVP_DigestInit(&ctx, EVP_md5()); EVP_DigestUpdate(&ctx, "\x31", 1); EVP_DigestUpdate(&ctx, attrs + 1, attrs_size - 1); EVP_DigestFinal(&ctx, sha1, NULL); + EVP_MD_CTX_cleanup(&ctx); } if(!fmap_need_ptr_once(map, asn1.content, asn1.size)) { diff --git a/libclamav/cache.c b/libclamav/cache.c index 417f5eaa7..10c8c730a 100644 --- a/libclamav/cache.c +++ b/libclamav/cache.c @@ -938,6 +938,7 @@ int cache_check(unsigned char *hash, cli_ctx *ctx) { } EVP_DigestFinal(&hashctx, hash, NULL); + EVP_MD_CTX_cleanup(&hashctx); ret = cache_lookup_hash(hash, map->len, ctx->engine->cache, ctx->recursion); cli_dbgmsg("cache_check: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x is %s\n", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8], hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15], (ret == CL_VIRUS) ? "negative" : "positive"); diff --git a/libclamav/crypto.c b/libclamav/crypto.c index bbae1b44c..c3b83ce18 100644 --- a/libclamav/crypto.c +++ b/libclamav/crypto.c @@ -131,6 +131,8 @@ unsigned char *cl_hash_data(char *alg, const void *buf, size_t len, unsigned cha return NULL; } + EVP_MD_CTX_cleanup(&ctx); + if ((olen)) *olen = i; @@ -215,6 +217,8 @@ unsigned char *cl_hash_file_fd_ctx(EVP_MD_CTX *ctx, int fd, unsigned int *olen) return NULL; } + EVP_MD_CTX_cleanup(&ctx); + if ((olen)) *olen = hashlen; diff --git a/libclamav/cvd.c b/libclamav/cvd.c index d69456e96..a51b4fd83 100644 --- a/libclamav/cvd.c +++ b/libclamav/cvd.c @@ -197,6 +197,11 @@ static void cli_tgzload_cleanup(int comp, struct cli_dbio *dbio, int fdd) free(dbio->buf); dbio->buf = NULL; } + + if (dbio->hashctx) { + EVP_MD_CTX_destroy(dbio->hashctx); + dbio->hashctx = NULL; + } } static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, unsigned int options, struct cli_dbio *dbio, struct cli_dbinfo *dbinfo) @@ -315,7 +320,14 @@ static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, un dbio->readsize = dbio->size < dbio->bufsize ? dbio->size : dbio->bufsize - 1; dbio->bufpt = NULL; dbio->readpt = dbio->buf; - EVP_DigestInit(&(dbio->hashctx), EVP_sha256()); + if (!(dbio->hashctx)) { + dbio->hashctx = EVP_MD_CTX_create(); + if (!(dbio->hashctx)) { + cli_tgzload_cleanup(compr, dbio, fdd); + return CL_EMALFDB; + } + EVP_DigestInit(dbio->hashctx, EVP_sha256()); + } dbio->bread = 0; /* cli_dbgmsg("cli_tgzload: Loading %s, size: %u\n", name, size); */ @@ -349,7 +361,8 @@ static int cli_tgzload(int fd, struct cl_engine *engine, unsigned int *signo, un cli_tgzload_cleanup(compr, dbio, fdd); return CL_EMALFDB; } - EVP_DigestFinal(&(dbio->hashctx), hash, NULL); + EVP_DigestFinal(dbio->hashctx, hash, NULL); + EVP_DigestInit(dbio->hashctx, EVP_sha256()); if(memcmp(db->hash, hash, 32)) { cli_errmsg("cli_tgzload: Invalid checksum for file %s\n", name); cli_tgzload_cleanup(compr, dbio, fdd); @@ -590,6 +603,8 @@ int cli_cvdload(FILE *fs, struct cl_engine *engine, unsigned int *signo, unsigne struct cli_dbinfo *dbinfo = NULL; char *dupname; + dbio.hashctx = NULL; + cli_dbgmsg("in cli_cvdload()\n"); /* verify */ diff --git a/libclamav/cvd.h b/libclamav/cvd.h index 22588e99c..0257b829d 100644 --- a/libclamav/cvd.h +++ b/libclamav/cvd.h @@ -32,7 +32,7 @@ struct cli_dbio { char *buf, *bufpt, *readpt; unsigned int usebuf, bufsize, readsize; unsigned int chkonly; - EVP_MD_CTX hashctx; + EVP_MD_CTX *hashctx; }; int cli_cvdload(FILE *fs, struct cl_engine *engine, unsigned int *signo, unsigned int options, unsigned int dbtype, const char *filename, unsigned int chkonly); diff --git a/libclamav/dsig.c b/libclamav/dsig.c index 10450414d..e278f35c5 100644 --- a/libclamav/dsig.c +++ b/libclamav/dsig.c @@ -191,6 +191,7 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n EVP_DigestUpdate(&ctx, digest2, HASH_LEN); EVP_DigestUpdate(&ctx, c, 4); EVP_DigestFinal(&ctx, digest3, NULL); + EVP_MD_CTX_cleanup(&ctx); if(i + 1 == rounds) memcpy(&data[i * 32], digest3, BLK_LEN - i * HASH_LEN); else @@ -215,6 +216,7 @@ int cli_versig2(const unsigned char *sha256, const char *dsig_str, const char *n EVP_DigestInit(&ctx, EVP_sha256()); EVP_DigestUpdate(&ctx, final, sizeof(final)); EVP_DigestFinal(&ctx, digest1, NULL); + EVP_MD_CTX_cleanup(&ctx); return memcmp(digest1, digest2, HASH_LEN) ? CL_EVERIFY : CL_SUCCESS; } diff --git a/libclamav/hostid.c b/libclamav/hostid.c index ac5a7f0ee..816595b9e 100644 --- a/libclamav/hostid.c +++ b/libclamav/hostid.c @@ -264,6 +264,7 @@ char *internal_get_host_id(void) EVP_DigestUpdate(&ctx, devices[i].mac, sizeof(devices[i].mac)); EVP_DigestFinal(&ctx, raw_md5, NULL); + EVP_MD_CTX_cleanup(&ctx); for (i=0; devices[i].name != NULL; i++) free(devices[i].name); diff --git a/libclamav/matcher.c b/libclamav/matcher.c index 63002d46f..7934976ea 100644 --- a/libclamav/matcher.c +++ b/libclamav/matcher.c @@ -750,8 +750,12 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli } if(ftonly) { - if(!troot) + if(!troot) { + EVP_MD_CTX_cleanup(&md5ctx); + EVP_MD_CTX_cleanup(&sha1ctx); + EVP_MD_CTX_cleanup(&sha256ctx); return CL_CLEAN; + } maxpatlen = troot->maxpatlen; } else { @@ -769,6 +773,9 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_cleanup(&md5ctx); + EVP_MD_CTX_cleanup(&sha1ctx); + EVP_MD_CTX_cleanup(&sha256ctx); return ret; } } @@ -781,6 +788,9 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_cleanup(&md5ctx); + EVP_MD_CTX_cleanup(&sha1ctx); + EVP_MD_CTX_cleanup(&sha256ctx); return ret; } if(troot->bm_offmode) { @@ -794,6 +804,9 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_cleanup(&md5ctx); + EVP_MD_CTX_cleanup(&sha1ctx); + EVP_MD_CTX_cleanup(&sha256ctx); return ret; } @@ -860,6 +873,9 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli free(info.exeinfo.section); cli_hashset_destroy(&info.exeinfo.vinfo); + EVP_MD_CTX_cleanup(&md5ctx); + EVP_MD_CTX_cleanup(&sha1ctx); + EVP_MD_CTX_cleanup(&sha256ctx); return ret; } } @@ -918,14 +934,17 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli if(!ftonly && hdb) { enum CLI_HASH_TYPE hashtype, hashtype2; - if(compute_hash[CLI_HASH_MD5]) + if(compute_hash[CLI_HASH_MD5]) { EVP_DigestFinal(&md5ctx, digest[CLI_HASH_MD5], NULL); + } if(refhash) compute_hash[CLI_HASH_MD5] = 1; - if(compute_hash[CLI_HASH_SHA1]) + if(compute_hash[CLI_HASH_SHA1]) { EVP_DigestFinal(&sha1ctx, digest[CLI_HASH_SHA1], NULL); - if(compute_hash[CLI_HASH_SHA256]) + } + if(compute_hash[CLI_HASH_SHA256]) { EVP_DigestFinal(&sha256ctx, digest[CLI_HASH_SHA256], NULL); + } virname = NULL; for(hashtype = CLI_HASH_MD5; hashtype < CLI_HASH_AVAIL_TYPES; hashtype++) { @@ -982,6 +1001,10 @@ int cli_fmap_scandesc(cli_ctx *ctx, cli_file_t ftype, uint8_t ftonly, struct cli } } + EVP_MD_CTX_cleanup(&md5ctx); + EVP_MD_CTX_cleanup(&sha1ctx); + EVP_MD_CTX_cleanup(&sha256ctx); + if(troot) { if(ret != CL_VIRUS || SCAN_ALL) ret = cli_lsig_eval(ctx, troot, &tdata, &info, refhash); diff --git a/libclamav/others.c b/libclamav/others.c index ef1ca664b..f2c6a962a 100644 --- a/libclamav/others.c +++ b/libclamav/others.c @@ -877,6 +877,7 @@ char *cli_hashstream(FILE *fs, unsigned char *digcpy, int type) EVP_DigestUpdate(&ctx, buff, bytes); EVP_DigestFinal(&ctx, digest, &size); + EVP_MD_CTX_cleanup(&ctx); if(!(hashstr = (char *) cli_calloc(size*2 + 1, sizeof(char)))) return NULL; diff --git a/libclamav/pe.c b/libclamav/pe.c index 7521b6d7d..44af640d9 100644 --- a/libclamav/pe.c +++ b/libclamav/pe.c @@ -2927,6 +2927,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin } cli_qsort(exe_sections, nsections, sizeof(*exe_sections), sort_sects); + EVP_DigestInit(&hashctx, EVP_sha1()); if (flags & CL_CHECKFP_PE_FLAG_AUTHENTICODE) { /* Check to see if we have a security section. */ @@ -2935,11 +2936,10 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin /* If stats is enabled, continue parsing the sample */ flags ^= CL_CHECKFP_PE_FLAG_AUTHENTICODE; } else { + EVP_MD_CTX_cleanup(&hashctx); return CL_BREAK; } } - - EVP_DigestInit(&hashctx, EVP_sha1()); } #define hash_chunk(where, size, isStatAble, section) \ @@ -2957,6 +2957,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin EVP_DigestInit(&md5ctx, EVP_md5()); \ EVP_DigestUpdate(&md5ctx, hptr, size); \ EVP_DigestFinal(&md5ctx, hashes->sections[section].md5, NULL); \ + EVP_MD_CTX_cleanup(&md5ctx); \ } \ } while(0) @@ -2981,6 +2982,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin break; } else { free(exe_sections); + EVP_MD_CTX_cleanup(&hashctx); return CL_EFORMAT; } } @@ -3012,6 +3014,7 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin break; } else { free(exe_sections); + EVP_MD_CTX_cleanup(&hashctx); return CL_EFORMAT; } } @@ -3042,8 +3045,10 @@ int cli_checkfp_pe(cli_ctx *ctx, uint8_t *authsha1, stats_section_t *hashes, uin hlen -= 8; + EVP_MD_CTX_cleanup(&hashctx); return asn1_check_mscat((struct cl_engine *)(ctx->engine), map, at + 8, hlen, authsha1); } else { + EVP_MD_CTX_cleanup(&hashctx); return CL_VIRUS; } } diff --git a/libclamav/phishcheck.c b/libclamav/phishcheck.c index f61de913c..78b288c0b 100644 --- a/libclamav/phishcheck.c +++ b/libclamav/phishcheck.c @@ -1208,6 +1208,7 @@ static int hash_match(const struct regex_matcher *rlist, const char *host, size_ EVP_DigestUpdate(&sha256, host, hlen); EVP_DigestUpdate(&sha256, path, plen); EVP_DigestFinal(&sha256, sha256_dig, NULL); + EVP_MD_CTX_cleanup(&sha256); for(i=0;i<32;i++) { h[2*i] = hexchars[sha256_dig[i]>>4]; diff --git a/libclamav/readdb.c b/libclamav/readdb.c index c07132ee7..e861200c2 100644 --- a/libclamav/readdb.c +++ b/libclamav/readdb.c @@ -420,7 +420,8 @@ char *cli_dbgets(char *buff, unsigned int size, FILE *fs, struct cli_dbio *dbio) dbio->bufpt = dbio->buf; dbio->size -= bread; dbio->bread += bread; - EVP_DigestUpdate(&(dbio->hashctx), dbio->readpt, bread); + if (dbio->hashctx) + EVP_DigestUpdate(dbio->hashctx, dbio->readpt, bread); } if(dbio->chkonly && dbio->bufpt) { dbio->bufpt = NULL; @@ -477,7 +478,8 @@ char *cli_dbgets(char *buff, unsigned int size, FILE *fs, struct cli_dbio *dbio) bs = strlen(buff); dbio->size -= bs; dbio->bread += bs; - EVP_DigestUpdate(&(dbio->hashctx), buff, bs); + if (dbio->hashctx) + EVP_DigestUpdate(dbio->hashctx, buff, bs); return pt; } } diff --git a/libclamav/xar.c b/libclamav/xar.c index f6c339277..f343d65ea 100644 --- a/libclamav/xar.c +++ b/libclamav/xar.c @@ -370,6 +370,7 @@ static void xar_hash_final(EVP_MD_CTX * hash_ctx, void * result, int hash) } EVP_DigestFinal(hash_ctx, result, NULL); + EVP_MD_CTX_cleanup(hash_ctx); } static int xar_hash_check(int hash, const void * result, const void * expected) diff --git a/unit_tests/valgrind.supp b/unit_tests/valgrind.supp index 61d5ada4f..079ffc1fd 100644 --- a/unit_tests/valgrind.supp +++ b/unit_tests/valgrind.supp @@ -64,13 +64,3 @@ fun:sendmmsg ... } -{ - openssl-leak-01 - Memcheck:Leak - fun:malloc - ... - fun:CRYPTO_malloc - ... - fun:EVP_DigestInit_ex - ... -}