2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Build libtest even if CMOCKA is not available

Be more selective about what is not built when CMOCKA is not available
so that fuzz/dns_qp and fuzz/dns_qpkey_name can link against it.
This commit is contained in:
Mark Andrews
2023-03-09 15:53:42 +11:00
parent eeba1b8793
commit 64c0065986
4 changed files with 21 additions and 28 deletions

View File

@@ -3,9 +3,7 @@ include $(top_srcdir)/Makefile.top
SUBDIRS = . lib doc
# build libtest before fuzz/* and bin/tests
if HAVE_CMOCKA
SUBDIRS += tests
endif HAVE_CMOCKA
# run fuzz tests before system tests
SUBDIRS += fuzz bin

View File

@@ -6,15 +6,19 @@ AM_CFLAGS += \
AM_CPPFLAGS += \
$(LIBISC_CFLAGS) \
$(LIBDNS_CFLAGS) \
$(LIBUV_CFLAGS) \
-DFUZZDIR=\"$(abs_srcdir)\"
$(LIBUV_CFLAGS) \
-DFUZZDIR=\"$(abs_srcdir)\" \
-I$(top_srcdir)/lib/dns \
-I$(top_srcdir)/lib/isc \
-I$(top_srcdir)/tests/include
AM_LDFLAGS += \
$(FUZZ_LDFLAGS)
LDADD += \
libfuzzmain.la \
$(LIBDNS_LIBS) \
LDADD += \
libfuzzmain.la \
$(top_builddir)/tests/libtest/libtest.la \
$(LIBDNS_LIBS) \
$(LIBISC_LIBS)
check_LTLIBRARIES = libfuzzmain.la
@@ -28,6 +32,8 @@ check_PROGRAMS = \
dns_message_parse \
dns_name_fromtext_target \
dns_name_fromwire \
dns_qp \
dns_qpkey_name \
dns_rdata_fromtext \
dns_rdata_fromwire_text \
isc_lex_getmastertoken \
@@ -51,24 +57,6 @@ dns_name_fromwire_SOURCES = \
old.c \
old.h
if HAVE_CMOCKA
check_PROGRAMS += \
dns_qp \
dns_qpkey_name
AM_CPPFLAGS += \
-I$(top_srcdir)/lib/dns \
-I$(top_srcdir)/lib/isc \
-I$(top_srcdir)/tests/include
# libisc needs to appear after libtest
LDADD += \
$(top_builddir)/tests/libtest/libtest.la \
$(LIBISC_LIBS)
endif HAVE_CMOCKA
TESTS = $(check_PROGRAMS)
if HAVE_FUZZ_LOG_COMPILER

View File

@@ -12,6 +12,10 @@ LDADD += \
$(LIBDNS_LIBS) \
$(LIBNS_LIBS)
SUBDIRS = libtest isc dns ns isccfg irs bench
SUBDIRS = libtest
if HAVE_CMOCKA
SUBDIRS += isc dns ns isccfg irs bench
endif HAVE_CMOCKA
check_PROGRAMS =

View File

@@ -16,13 +16,16 @@ LDADD += \
noinst_LTLIBRARIES = libtest.la
libtest_la_SOURCES = \
../include/tests/dns.h \
../include/tests/isc.h \
../include/tests/ns.h \
../include/tests/qp.h \
dns.c \
isc.c \
ns.c \
qp.c
if HAVE_CMOCKA
libtest_la_SOURCES += \
../include/tests/dns.h \
dns.c
endif HAVE_CMOCKA
include $(top_srcdir)/Makefile.tests