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