Commit 3914654f authored by Jeremy C. Reed's avatar Jeremy C. Reed

Allow build outside of read-only source tree.

Identify files that need to be included in the tarball.
Also change some from Makefile.am entries to identify that are
not in the tarball (since later generated during build).

Includes needed for headers in src tree and in build tree
(because some includes are generated).
Also includes specifically for "dns" needed since headers
in src tree don't see the ones in build tree and vice versa.

Have the gen-rdatacode.py script read placeholder from src tree
and save generated files into build tree. Okayed by Jinmei.

Identify a few files that should be removed on a clean.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1389 e5f2f494-b856-4b98-b285-d166d9295462
parent c600aab4
SUBDIRS = . tests
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext $(SQLITE_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
AM_CPPFLAGS += -I$(top_srcdir)/ext
if GCC_WERROR_OK
AM_CPPFLAGS += -Werror
endif
......@@ -29,3 +31,5 @@ endif
b10_authdir = $(DESTDIR)$(pkgdatadir)
b10_auth_DATA = auth.spec
EXTRA_DIST = auth.spec
......@@ -6,6 +6,8 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@
bind10dir = $(DESTDIR)$(pkgdatadir)
bind10_DATA = bob.spec
EXTRA_DIST = bob.spec
# TODO: does this need $$(DESTDIR) also?
# this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix
bind10: bind10.py
......
bin_SCRIPTS = bindctl
man_MANS = bindctl.1
EXTRA_DIST = $(man_MANS)
CLEANFILES = bindctl
bindctl: bindctl.py
$(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
-e "s|@@LIBEXECDIR@@|$(pkglibexecdir)|" bindctl.py >$@
......
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
AM_CPPFLAGS += -I$(top_srcdir)/ext
CLEANFILES = *.gcno *.gcda
......
bin_SCRIPTS = b10-loadzone
CLEANFILES = b10-loadzone
b10-loadzone: b10-loadzone.py
$(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
-e "s|@@LIBEXECDIR@@|$(pkglibexecdir)|" b10-loadzone.py >$@
......
......@@ -5,6 +5,8 @@ pkglibexec_SCRIPTS = b10-xfrin
b10_xfrindir = $(DESTDIR)$(pkgdatadir)
b10_xfrin_DATA = xfrin.spec
EXTRA_DIST = xfrin.spec
CLEANFILES= b10-xfrin
# TODO: does this need $$(DESTDIR) also?
......
SUBDIRS = . tests
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext $(SQLITE_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
AM_CPPFLAGS += -I$(top_srcdir)/ext $(SQLITE_CFLAGS)
CLEANFILES = *.gcno *.gcda
......
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/ext
lib_LIBRARIES = libcc.a
libcc_a_SOURCES = data.cc data.h session.cc session.h
......
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/ext
lib_LTLIBRARIES = libcfgclient.la
libcfgclient_la_SOURCES = config_data.h config_data.cc module_spec.h module_spec.cc ccsession.cc ccsession.h
......
SUBDIRS = . tests
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/ext
if GCC_WERROR_OK
AM_CPPFLAGS += -Werror
endif
......@@ -8,16 +9,63 @@ endif
CLEANFILES = *.gcno *.gcda
CLEANFILES += rrclass.h rrtype.h rrparamregistry.cc rdataclass.h rdataclass.cc
EXTRA_DIST = rrclass-placeholder.h
EXTRA_DIST += rrparamregistry-placeholder.cc
EXTRA_DIST += rrtype-placeholder.h
# TODO: double-check that this is the only way
# NOTE: when an rdata file is added, please also add to this list:
EXTRA_DIST += rdata/in_1/aaaa_28.cc
EXTRA_DIST += rdata/in_1/aaaa_28.h
EXTRA_DIST += rdata/in_1/a_1.cc
EXTRA_DIST += rdata/in_1/a_1.h
EXTRA_DIST += rdata/ch_3/a_1.cc
EXTRA_DIST += rdata/ch_3/a_1.h
EXTRA_DIST += rdata/generic/mx_15.h
EXTRA_DIST += rdata/generic/rrsig_46.cc
EXTRA_DIST += rdata/generic/dname_39.cc
EXTRA_DIST += rdata/generic/rrsig_46.h
EXTRA_DIST += rdata/generic/dname_39.h
EXTRA_DIST += rdata/generic/ns_2.cc
EXTRA_DIST += rdata/generic/nsec_47.cc
EXTRA_DIST += rdata/generic/ns_2.h
EXTRA_DIST += rdata/generic/nsec_47.h
EXTRA_DIST += rdata/generic/opt_41.cc
EXTRA_DIST += rdata/generic/soa_6.cc
EXTRA_DIST += rdata/generic/cname_5.cc
EXTRA_DIST += rdata/generic/dnskey_48.cc
EXTRA_DIST += rdata/generic/opt_41.h
EXTRA_DIST += rdata/generic/soa_6.h
EXTRA_DIST += rdata/generic/cname_5.h
EXTRA_DIST += rdata/generic/dnskey_48.h
EXTRA_DIST += rdata/generic/ds_43.cc
EXTRA_DIST += rdata/generic/ds_43.h
EXTRA_DIST += rdata/generic/txt_16.cc
EXTRA_DIST += rdata/generic/txt_16.h
EXTRA_DIST += rdata/generic/mx_15.cc
EXTRA_DIST += rdata/generic/nsec3param_51.h
EXTRA_DIST += rdata/generic/nsec3param_51.cc
EXTRA_DIST += rdata/generic/nsec3_50.cc
EXTRA_DIST += rdata/generic/nsec3_50.h
EXTRA_DIST += rdata/generic/ptr_12.cc
EXTRA_DIST += rdata/generic/ptr_12.h
EXTRA_DIST += rdata/hs_4/a_1.cc
EXTRA_DIST += rdata/hs_4/a_1.h
#EXTRA_DIST += rdata/template.cc
#EXTRA_DIST += rdata/template.h
# auto-generate by gen-rdatacode.py:
BUILT_SOURCES = rrclass.h rrtype.h rrparamregistry.cc
#TODO: check this###BUILT_SOURCES = rdataclass.h rdataclass.cc
lib_LTLIBRARIES = libdns.la
libdns_la_SOURCES = buffer.h name.cc name.h messagerenderer.h messagerenderer.cc
libdns_la_SOURCES += exceptions.h exceptions.cc
libdns_la_SOURCES += rrparamregistry.h rrparamregistry.cc
libdns_la_SOURCES += rrclass.h rrclass.cc rrtype.h rrtype.cc rrttl.h rrttl.cc
libdns_la_SOURCES += rrparamregistry.h
libdns_la_SOURCES += rrclass.cc
libdns_la_SOURCES += rrtype.cc
libdns_la_SOURCES += rrttl.h rrttl.cc
libdns_la_SOURCES += rdata.h rdata.cc
libdns_la_SOURCES += rdataclass.h rdataclass.cc
libdns_la_SOURCES += rrset.h rrset.cc
libdns_la_SOURCES += rrsetlist.h rrsetlist.cc
libdns_la_SOURCES += question.h question.cc
......@@ -29,6 +77,9 @@ libdns_la_SOURCES += tsig.h tsig.cc
libdns_la_SOURCES += dnssectime.h dnssectime.cc
libdns_la_SOURCES += hex.h hex.cc
nodist_libdns_la_SOURCES = rrparamregistry.cc
nodist_libdns_la_SOURCES += rdataclass.cc
rrclass.h: rrclass-placeholder.h
rrtype.h: rrtype-placeholder.h
rrparamregistry.cc: rrparamregistry-placeholder.cc
......
......@@ -203,8 +203,8 @@ def generate_rdatahdr(file, declarations, basemtime):
rdata_header.close()
def generate_typeclasscode(fileprefix, basemtime, code2txt, type_or_class):
placeholder = fileprefix + '-placeholder.h'
outputfile = fileprefix + '.h'
placeholder = '@srcdir@/' + fileprefix + '-placeholder.h'
outputfile = '@builddir@/' + fileprefix + '.h'
upper_key = type_or_class.upper() # TYPE or CLASS
lower_key = 'rr' + type_or_class.lower() # rrtype or rrclass
cap_key = type_or_class # Type or Class
......@@ -238,8 +238,8 @@ RR''' + cap_key + '''::''' + codetxt + '''()
header_temp.close()
def generate_rrparam(fileprefix, basemtime):
placeholder = fileprefix + '-placeholder.cc'
outputfile = fileprefix + '.cc'
placeholder = '@srcdir@/' + fileprefix + '-placeholder.cc'
outputfile = '@builddir@/' + fileprefix + '.cc'
if not need_generate(outputfile, basemtime) and getmtime(outputfile) > getmtime(placeholder):
print('skip generating ' + outputfile)
return
......@@ -281,15 +281,15 @@ def generate_rrparam(fileprefix, basemtime):
if __name__ == "__main__":
try:
import_definitions(classcode2txt, typecode2txt, typeandclass)
generate_rdatadef('@srcdir@/rdataclass.cc', rdatadef_mtime)
generate_rdatahdr('@srcdir@/rdataclass.h', rdata_declarations,
generate_rdatadef('@builddir@/rdataclass.cc', rdatadef_mtime)
generate_rdatahdr('@builddir@/rdataclass.h', rdata_declarations,
rdatahdr_mtime)
generate_typeclasscode('@srcdir@/rrtype',
generate_typeclasscode('rrtype',
max(rdatadef_mtime, rdatahdr_mtime),
typecode2txt, 'Type')
generate_typeclasscode('@srcdir@/rrclass', classdir_mtime,
generate_typeclasscode('rrclass', classdir_mtime,
classcode2txt, 'Class')
generate_rrparam('@srcdir@/rrparamregistry', rdatahdr_mtime)
generate_rrparam('rrparamregistry', rdatahdr_mtime)
except:
sys.stderr.write('Code generation failed due to exception: %s\n' %
sys.exc_info()[1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment