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