kumquat-buildroot/package/clamav/clamav.mk
Bernd Kuhls 19d1ca28d2 package/clamav: needs dynamic library
Upstream commit
9e20cdf6ea
added dlopen() to others.c
https://github.com/Cisco-Talos/clamav-devel/blob/dev/0.104/libclamav/others.c#L199

"libclamav used to build in multiple stages where an earlier stage is
a static library containing utils required by the "shared" code.
Linking clamdscan and clamdtop with this libclamav utils static lib
allowed these two apps to function without libclamav. While this is
nice in theory, the practical gains are minimal and it complicates
the build system. As such, the autotools and CMake tooling was
simplified for improved maintainability and this feature was thrown
out. clamdtop and clamdscan now require libclamav to function."

Fixes:
http://autobuild.buildroot.net/results/e27/e276894781e3e37fbc03a0745738c61541e0a211/
http://autobuild.buildroot.net/results/552/552ee8d9e44152c9d7e315a5491542771264d466/
http://autobuild.buildroot.net/results/fde/fde4af47542f0eb0bd57b172c99bd086eb566b76/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-09-23 20:45:23 +02:00

101 lines
2.4 KiB
Makefile

################################################################################
#
# clamav
#
################################################################################
CLAMAV_VERSION = 0.103.0
CLAMAV_SITE = https://www.clamav.net/downloads/production
CLAMAV_LICENSE = GPL-2.0
CLAMAV_LICENSE_FILES = COPYING COPYING.bzip2 COPYING.file COPYING.getopt \
COPYING.LGPL COPYING.llvm COPYING.lzma COPYING.pcre COPYING.regex \
COPYING.unrar COPYING.zlib
CLAMAV_DEPENDENCIES = \
host-pkgconf \
libcurl \
libmspack \
openssl \
zlib \
$(TARGET_NLS_DEPENDENCIES)
# mmap cannot be detected when cross-compiling, needed for mempool support
CLAMAV_CONF_ENV = \
ac_cv_c_mmap_private=yes \
have_cv_ipv6=yes \
OBJC=$(TARGET_CC)
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
CLAMAV_LIBS += -latomic
endif
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
CLAMAV_DEPENDENCIES += musl-fts
CLAMAV_LIBS += -lfts
endif
CLAMAV_CONF_ENV += LIBS="$(CLAMAV_LIBS)"
CLAMAV_CONF_OPTS = \
--with-dbdir=/var/lib/clamav \
--with-libcurl=$(STAGING_DIR)/usr \
--with-openssl=$(STAGING_DIR)/usr \
--with-system-libmspack=$(STAGING_DIR)/usr \
--with-zlib=$(STAGING_DIR)/usr \
--disable-zlib-vcheck \
--disable-rpath \
--disable-clamav \
--disable-milter \
--disable-llvm \
--disable-clamdtop \
--enable-mempool
ifeq ($(BR2_PACKAGE_BZIP2),y)
CLAMAV_DEPENDENCIES += bzip2
# autodetection gets confused if host has bzip2, so force it
CLAMAV_CONF_ENV += \
ac_cv_libbz2_libs=-lbz2 \
ac_cv_libbz2_ltlibs=-lbz2
else
CLAMAV_CONF_OPTS += --disable-bzip2
endif
ifeq ($(BR2_PACKAGE_JSON_C),y)
CLAMAV_CONF_OPTS += --with-libjson=$(STAGING_DIR)/usr
CLAMAV_DEPENDENCIES += json-c
else
CLAMAV_CONF_OPTS += --without-libjson
endif
ifeq ($(BR2_PACKAGE_LIBXML2),y)
CLAMAV_CONF_OPTS += --with-xml=$(STAGING_DIR)/usr
CLAMAV_DEPENDENCIES += libxml2
else
CLAMAV_CONF_OPTS += --disable-xml
endif
ifeq ($(BR2_PACKAGE_LIBICONV),y)
CLAMAV_CONF_OPTS += --with-iconv
CLAMAV_DEPENDENCIES += libiconv
else
CLAMAV_CONF_OPTS += --without-iconv
endif
ifeq ($(BR2_PACKAGE_PCRE2),y)
CLAMAV_CONF_OPTS += --with-pcre=$(STAGING_DIR)/usr
CLAMAV_DEPENDENCIES += pcre2
else ifeq ($(BR2_PACKAGE_PCRE),y)
CLAMAV_CONF_OPTS += --with-pcre=$(STAGING_DIR)/usr
CLAMAV_DEPENDENCIES += pcre
else
CLAMAV_CONF_OPTS += --without-pcre
endif
ifeq ($(BR2_INIT_SYSTEMD),y)
CLAMAV_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
CLAMAV_DEPENDENCIES += systemd
else
CLAMAV_CONF_OPTS += --with-systemdsystemunitdir=no
endif
$(eval $(autotools-package))