Building fails in build subdirectory when dnstap is enabled
Summary
Attempting to build bind in a build subdirectory fails when the build is configured with --enable-dnstap. This also prevents rebuilding the Ubuntu source package with dnstap support.
BIND version used
gitlab master branch (7311ebe9)
Steps to reproduce
mkdir build && cd build
../configure --enable-dnstap
make
What is the current bug behavior?
Outside of the build directory (that is, in the root of the git repo) or without --enable-dnstap, the build succeeds. Otherwise it looks like this:
make[2]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns'
gcc -g -O2 -pthread -I/usr/include/libxml2 -I/usr/include/google -fPIC -I../../../lib/isc/include \
-Wl,--export-dynamic -o gen ../../../lib/dns/gen.c -ldl -lprotobuf-c -lfstrm -lz -ljson-c -lxml2
make include/dns/enumtype.h
make[3]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns'
./gen -s ../../../lib/dns -t > include/dns/enumtype.h || { rm -f include/dns/enumtype.h ; exit 1; }
make[3]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns'
make include/dns/enumclass.h
make[3]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns'
./gen -s ../../../lib/dns -c > include/dns/enumclass.h || { rm -f include/dns/enumclass.h ; exit 1; }
make[3]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns'
make include/dns/rdatastruct.h
make[3]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns'
./gen -s ../../../lib/dns -i \
-P ../../../lib/dns/rdata/rdatastructpre.h \
-S ../../../lib/dns/rdata/rdatastructsuf.h > include/dns/rdatastruct.h || \
{ rm -f include/dns/rdatastruct.h ; exit 1; }
make[3]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns'
make code.h
make[3]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns'
./gen -s ../../../lib/dns > code.h || { rm -f code.h ; exit 1; }
make[3]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns'
making all in /bind/upstream/gitlab/bind9/build/lib/dns/include
make[3]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns/include'
making all in /bind/upstream/gitlab/bind9/build/lib/dns/include/dns
make[4]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns/include/dns'
make[4]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns/include/dns'
making all in /bind/upstream/gitlab/bind9/build/lib/dns/include/dst
make[4]: Entering directory '/bind/upstream/gitlab/bind9/build/lib/dns/include/dst'
make[4]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns/include/dst'
make[3]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns/include'
/usr/bin/protoc-c --c_out=. dnstap.proto
dnstap.proto: No such file or directory
make[2]: *** [dnstap.pb-c.c] Error 1
Makefile:633: recipe for target 'dnstap.pb-c.c' failed
make[2]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib/dns'
Makefile:82: recipe for target 'subdirs' failed
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory '/bind/upstream/gitlab/bind9/build/lib'
make: *** [subdirs] Error 1
Makefile:89: recipe for target 'subdirs' failed
What is the expected correct behavior?
The build should succeed.
Relevant configuration files
N/A
Relevant logs and/or screenshots
N/A
Possible fixes
I don't have a lot of experience with autotools, but I fumbled my way into this, which seems to fix my problem:
diff --git a/configure b/configure
index fde843e2ee..a0403ad166 100755
--- a/configure
+++ b/configure
@@ -21505,7 +21505,7 @@ ac_config_commands="$ac_config_commands chmod"
# elsewhere if there's a good reason for doing so.
#
-ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/pthreads/Makefile lib/isc/pthreads/include/Makefile lib/isc/pthreads/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccc/tests/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/unittest.sh fuzz/Makefile"
+ac_config_files="$ac_config_files make/Makefile make/mkdep Makefile bin/Makefile bin/check/Makefile bin/confgen/Makefile bin/confgen/unix/Makefile bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile bin/named/Makefile bin/named/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile bin/python/Makefile bin/python/isc/Makefile bin/python/isc/utils.py bin/python/isc/tests/Makefile bin/python/dnssec-checkds.py bin/python/dnssec-coverage.py bin/python/dnssec-keymgr.py bin/python/isc/__init__.py bin/python/isc/checkds.py bin/python/isc/coverage.py bin/python/isc/dnskey.py bin/python/isc/eventlist.py bin/python/isc/keydict.py bin/python/isc/keyevent.py bin/python/isc/keymgr.py bin/python/isc/keyseries.py bin/python/isc/keyzone.py bin/python/isc/policy.py bin/python/isc/rndc.py bin/python/isc/tests/dnskey_test.py bin/python/isc/tests/policy_test.py bin/rndc/Makefile bin/tests/Makefile bin/tests/headerdep_test.sh bin/tests/optional/Makefile bin/tests/pkcs11/Makefile bin/tests/pkcs11/benchmarks/Makefile bin/tests/system/Makefile bin/tests/system/conf.sh bin/tests/system/dlz/prereq.sh bin/tests/system/dlzexternal/Makefile bin/tests/system/dlzexternal/ns1/dlzs.conf bin/tests/system/dyndb/Makefile bin/tests/system/dyndb/driver/Makefile bin/tests/system/pipelined/Makefile bin/tests/system/rndc/Makefile bin/tests/system/rpz/Makefile bin/tests/system/rsabigexponent/Makefile bin/tests/system/tkey/Makefile bin/tests/virtual-time/Makefile bin/tests/virtual-time/conf.sh bin/tools/Makefile contrib/scripts/check-secure-delegation.pl contrib/scripts/zone-edit.sh doc/Makefile doc/arm/Makefile doc/arm/noteversion.xml doc/arm/pkgversion.xml doc/arm/releaseinfo.xml doc/doxygen/Doxyfile doc/doxygen/Makefile doc/doxygen/doxygen-input-filter doc/misc/Makefile doc/tex/Makefile doc/tex/armstyle.sty doc/xsl/Makefile doc/xsl/isc-docbook-chunk.xsl doc/xsl/isc-docbook-html.xsl doc/xsl/isc-manpage.xsl doc/xsl/isc-notes-html.xsl isc-config.sh lib/Makefile lib/bind9/Makefile lib/bind9/include/Makefile lib/bind9/include/bind9/Makefile lib/dns/Makefile lib/dns/dnstap.proto lib/dns/include/Makefile lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile lib/irs/include/irs/netdb.h lib/irs/include/irs/platform.h lib/irs/tests/Makefile lib/isc/pthreads/Makefile lib/isc/pthreads/include/Makefile lib/isc/pthreads/include/isc/Makefile lib/isc/Makefile lib/isc/include/Makefile lib/isc/include/isc/Makefile lib/isc/include/isc/platform.h lib/isc/include/pk11/Makefile lib/isc/include/pkcs11/Makefile lib/isc/tests/Makefile lib/isc/unix/Makefile lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile lib/isccc/Makefile lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile lib/isccc/tests/Makefile lib/isccfg/Makefile lib/isccfg/include/Makefile lib/isccfg/include/isccfg/Makefile lib/isccfg/tests/Makefile lib/ns/Makefile lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall unit/unittest.sh fuzz/Makefile"
#
@@ -22586,6 +22586,7 @@ do
"lib/bind9/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/bind9/include/Makefile" ;;
"lib/bind9/include/bind9/Makefile") CONFIG_FILES="$CONFIG_FILES lib/bind9/include/bind9/Makefile" ;;
"lib/dns/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/Makefile" ;;
+ "lib/dns/dnstap.proto") CONFIG_FILES="$CONFIG_FILES lib/dns/dnstap.proto" ;;
"lib/dns/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/Makefile" ;;
"lib/dns/include/dns/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/dns/Makefile" ;;
"lib/dns/include/dst/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dns/include/dst/Makefile" ;;
diff --git a/configure.ac b/configure.ac
index 42add3a29b..95813450e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3001,6 +3001,7 @@ AC_CONFIG_FILES([
lib/bind9/include/Makefile
lib/bind9/include/bind9/Makefile
lib/dns/Makefile
+ lib/dns/dnstap.proto
lib/dns/include/Makefile
lib/dns/include/dns/Makefile
lib/dns/include/dst/Makefile
diff --git a/lib/dns/.gitignore b/lib/dns/.gitignore
index 66c95ddd79..9013581713 100644
--- a/lib/dns/.gitignore
+++ b/lib/dns/.gitignore
@@ -6,4 +6,5 @@ enumtype.h
rdatastruct.h
gen.dSYM
dnstap.pb-c.c
-dnstap.pb-c.h
\ No newline at end of file
+dnstap.pb-c.h
+dnstap.proto
diff --git a/lib/dns/dnstap.proto b/lib/dns/dnstap.proto.in
similarity index 100%
rename from lib/dns/dnstap.proto
rename to lib/dns/dnstap.proto.in
--
2.20.1