199a5d
From e645046202006750f87531e21e3ff7c26fba3466 Mon Sep 17 00:00:00 2001
199a5d
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
199a5d
Date: Wed, 30 Jan 2019 14:37:17 +0100
199a5d
Subject: [PATCH] Create feature-test in source directory
199a5d
199a5d
Feature-test tool is used in system tests to test compiled in changes.
199a5d
Because we build more variants of named with different configuration,
199a5d
compile feature-test for each of them this way.
199a5d
---
199a5d
 bin/named/Makefile.in       | 12 +++++++++++-
199a5d
 bin/tests/system/conf.sh.in |  2 +-
199a5d
 2 files changed, 12 insertions(+), 2 deletions(-)
199a5d
199a5d
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
199a5d
index 37053a7..ed9add2 100644
199a5d
--- a/bin/named/Makefile.in
199a5d
+++ b/bin/named/Makefile.in
199a5d
@@ -91,7 +91,7 @@ NOSYMLIBS =	${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \
199a5d
 
199a5d
 SUBDIRS =	unix
199a5d
 
199a5d
-TARGETS =	named@EXEEXT@
199a5d
+TARGETS =	named@EXEEXT@ feature-test@EXEEXT@
199a5d
 
199a5d
 GEOIP2LINKOBJS = geoip.@O@
199a5d
 
199a5d
@@ -154,6 +154,16 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS}
199a5d
 	export BASEOBJS="${OBJS} ${UOBJS}"; \
199a5d
 	${FINALBUILDCMD}
199a5d
 
199a5d
+# Bit of hack, do not produce intermediate .o object for featuretest
199a5d
+feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c
199a5d
+	${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
199a5d
+		-c ${top_srcdir}/bin/tests/system/feature-test.c
199a5d
+
199a5d
+feature-test@EXEEXT@: feature-test.@O@
199a5d
+	${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
199a5d
+		-o $@ feature-test.@O@ ${ISCLIBS} ${LIBS}
199a5d
+
199a5d
+
199a5d
 clean distclean maintainer-clean::
199a5d
 	rm -f ${TARGETS} ${OBJS}
199a5d
 
199a5d
diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in
199a5d
index 7934930..e84fde2 100644
199a5d
--- a/bin/tests/system/conf.sh.in
199a5d
+++ b/bin/tests/system/conf.sh.in
199a5d
@@ -37,7 +37,7 @@ DELV=$TOP/bin/delv/delv
199a5d
 DIG=$TOP/bin/dig/dig
199a5d
 DNSTAPREAD=$TOP/bin/tools/dnstap-read
199a5d
 DSFROMKEY=$TOP/bin/dnssec/dnssec-dsfromkey
199a5d
-FEATURETEST=$TOP/bin/tests/system/feature-test
199a5d
+FEATURETEST=$TOP/bin/named/feature-test
199a5d
 FSTRM_CAPTURE=@FSTRM_CAPTURE@
199a5d
 HOST=$TOP/bin/dig/host
199a5d
 IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey
199a5d
-- 
199a5d
2.26.2
199a5d