Browse Source

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
Jeremy C. Reed 15 years ago
parent
commit
3914654f19

+ 5 - 1
src/bin/auth/Makefile.am

@@ -1,6 +1,8 @@
 SUBDIRS = . tests
 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
 if GCC_WERROR_OK
 AM_CPPFLAGS += -Werror
 AM_CPPFLAGS += -Werror
 endif
 endif
@@ -29,3 +31,5 @@ endif
 b10_authdir = $(DESTDIR)$(pkgdatadir)
 b10_authdir = $(DESTDIR)$(pkgdatadir)
 b10_auth_DATA = auth.spec
 b10_auth_DATA = auth.spec
 
 
+EXTRA_DIST = auth.spec
+

+ 2 - 0
src/bin/bind10/Makefile.am

@@ -6,6 +6,8 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@
 bind10dir = $(DESTDIR)$(pkgdatadir)
 bind10dir = $(DESTDIR)$(pkgdatadir)
 bind10_DATA = bob.spec
 bind10_DATA = bob.spec
 
 
+EXTRA_DIST = bob.spec
+
 # TODO: does this need $$(DESTDIR) also?
 # TODO: does this need $$(DESTDIR) also?
 # this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix
 # this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix
 bind10: bind10.py
 bind10: bind10.py

+ 4 - 0
src/bin/bindctl/Makefile.am

@@ -1,6 +1,10 @@
 bin_SCRIPTS = bindctl
 bin_SCRIPTS = bindctl
 man_MANS = bindctl.1
 man_MANS = bindctl.1
 
 
+EXTRA_DIST = $(man_MANS)
+
+CLEANFILES = bindctl
+
 bindctl: bindctl.py
 bindctl: bindctl.py
 	$(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
 	$(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
 	       -e "s|@@LIBEXECDIR@@|$(pkglibexecdir)|" bindctl.py >$@
 	       -e "s|@@LIBEXECDIR@@|$(pkglibexecdir)|" bindctl.py >$@

+ 3 - 1
src/bin/host/Makefile.am

@@ -1,4 +1,6 @@
-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
 CLEANFILES = *.gcno *.gcda
 
 

+ 2 - 0
src/bin/loadzone/Makefile.am

@@ -1,5 +1,7 @@
 bin_SCRIPTS = b10-loadzone
 bin_SCRIPTS = b10-loadzone
 
 
+CLEANFILES = b10-loadzone
+
 b10-loadzone: b10-loadzone.py
 b10-loadzone: b10-loadzone.py
 	$(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
 	$(SED) -e "s|@@PYTHONPATH@@|@pyexecdir@|" \
 	       -e "s|@@LIBEXECDIR@@|$(pkglibexecdir)|" b10-loadzone.py >$@
 	       -e "s|@@LIBEXECDIR@@|$(pkglibexecdir)|" b10-loadzone.py >$@

+ 2 - 0
src/bin/xfrin/Makefile.am

@@ -5,6 +5,8 @@ pkglibexec_SCRIPTS = b10-xfrin
 b10_xfrindir = $(DESTDIR)$(pkgdatadir)
 b10_xfrindir = $(DESTDIR)$(pkgdatadir)
 b10_xfrin_DATA = xfrin.spec
 b10_xfrin_DATA = xfrin.spec
 
 
+EXTRA_DIST = xfrin.spec
+
 CLEANFILES=	b10-xfrin
 CLEANFILES=	b10-xfrin
 
 
 # TODO: does this need $$(DESTDIR) also?
 # TODO: does this need $$(DESTDIR) also?

+ 3 - 1
src/lib/auth/Makefile.am

@@ -1,6 +1,8 @@
 SUBDIRS = . tests
 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
 CLEANFILES = *.gcno *.gcda
 
 

+ 2 - 1
src/lib/cc/Makefile.am

@@ -1,4 +1,5 @@
-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
 lib_LIBRARIES = libcc.a
 libcc_a_SOURCES = data.cc data.h session.cc session.h
 libcc_a_SOURCES = data.cc data.h session.cc session.h

+ 2 - 1
src/lib/config/Makefile.am

@@ -1,4 +1,5 @@
-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
 lib_LTLIBRARIES = libcfgclient.la
 libcfgclient_la_SOURCES = config_data.h config_data.cc module_spec.h module_spec.cc ccsession.cc ccsession.h
 libcfgclient_la_SOURCES = config_data.h config_data.cc module_spec.h module_spec.cc ccsession.cc ccsession.h

+ 55 - 4
src/lib/dns/Makefile.am

@@ -1,6 +1,7 @@
 SUBDIRS = . tests
 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
 if GCC_WERROR_OK
 AM_CPPFLAGS += -Werror
 AM_CPPFLAGS += -Werror
 endif
 endif
@@ -8,16 +9,63 @@ endif
 CLEANFILES = *.gcno *.gcda
 CLEANFILES = *.gcno *.gcda
 CLEANFILES += rrclass.h rrtype.h rrparamregistry.cc rdataclass.h rdataclass.cc
 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:
 # auto-generate by gen-rdatacode.py:
 BUILT_SOURCES = rrclass.h rrtype.h rrparamregistry.cc
 BUILT_SOURCES = rrclass.h rrtype.h rrparamregistry.cc
+#TODO: check this###BUILT_SOURCES = rdataclass.h rdataclass.cc
 
 
 lib_LTLIBRARIES = libdns.la
 lib_LTLIBRARIES = libdns.la
 libdns_la_SOURCES = buffer.h name.cc name.h messagerenderer.h messagerenderer.cc
 libdns_la_SOURCES = buffer.h name.cc name.h messagerenderer.h messagerenderer.cc
 libdns_la_SOURCES += exceptions.h exceptions.cc
 libdns_la_SOURCES += exceptions.h exceptions.cc
-libdns_la_SOURCES += rrparamregistry.h rrparamregistry.cc
+libdns_la_SOURCES += rrparamregistry.h
-libdns_la_SOURCES += rrclass.h rrclass.cc rrtype.h rrtype.cc rrttl.h rrttl.cc
+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 += rdata.h rdata.cc
-libdns_la_SOURCES += rdataclass.h rdataclass.cc
 libdns_la_SOURCES += rrset.h rrset.cc
 libdns_la_SOURCES += rrset.h rrset.cc
 libdns_la_SOURCES += rrsetlist.h rrsetlist.cc
 libdns_la_SOURCES += rrsetlist.h rrsetlist.cc
 libdns_la_SOURCES += question.h question.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 += dnssectime.h dnssectime.cc
 libdns_la_SOURCES += hex.h hex.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
 rrclass.h: rrclass-placeholder.h
 rrtype.h: rrtype-placeholder.h
 rrtype.h: rrtype-placeholder.h
 rrparamregistry.cc: rrparamregistry-placeholder.cc
 rrparamregistry.cc: rrparamregistry-placeholder.cc

+ 9 - 9
src/lib/dns/gen-rdatacode.py.in

@@ -203,8 +203,8 @@ def generate_rdatahdr(file, declarations, basemtime):
     rdata_header.close()
     rdata_header.close()
 
 
 def generate_typeclasscode(fileprefix, basemtime, code2txt, type_or_class):
 def generate_typeclasscode(fileprefix, basemtime, code2txt, type_or_class):
-    placeholder = fileprefix + '-placeholder.h'
+    placeholder = '@srcdir@/' + fileprefix + '-placeholder.h'
-    outputfile = fileprefix + '.h'
+    outputfile = '@builddir@/' + fileprefix + '.h'
     upper_key = type_or_class.upper() # TYPE or CLASS
     upper_key = type_or_class.upper() # TYPE or CLASS
     lower_key = 'rr' + type_or_class.lower() # rrtype or rrclass
     lower_key = 'rr' + type_or_class.lower() # rrtype or rrclass
     cap_key = type_or_class           # Type or Class
     cap_key = type_or_class           # Type or Class
@@ -238,8 +238,8 @@ RR''' + cap_key + '''::''' + codetxt + '''()
     header_temp.close()
     header_temp.close()
 
 
 def generate_rrparam(fileprefix, basemtime):
 def generate_rrparam(fileprefix, basemtime):
-    placeholder = fileprefix + '-placeholder.cc'
+    placeholder = '@srcdir@/' + fileprefix + '-placeholder.cc'
-    outputfile = fileprefix + '.cc'
+    outputfile = '@builddir@/' + fileprefix + '.cc'
     if not need_generate(outputfile, basemtime) and getmtime(outputfile) > getmtime(placeholder):
     if not need_generate(outputfile, basemtime) and getmtime(outputfile) > getmtime(placeholder):
         print('skip generating ' + outputfile)
         print('skip generating ' + outputfile)
         return
         return
@@ -281,15 +281,15 @@ def generate_rrparam(fileprefix, basemtime):
 if __name__ == "__main__":
 if __name__ == "__main__":
     try:
     try:
         import_definitions(classcode2txt, typecode2txt, typeandclass)
         import_definitions(classcode2txt, typecode2txt, typeandclass)
-        generate_rdatadef('@srcdir@/rdataclass.cc', rdatadef_mtime)
+        generate_rdatadef('@builddir@/rdataclass.cc', rdatadef_mtime)
-        generate_rdatahdr('@srcdir@/rdataclass.h', rdata_declarations,
+        generate_rdatahdr('@builddir@/rdataclass.h', rdata_declarations,
                           rdatahdr_mtime)
                           rdatahdr_mtime)
-        generate_typeclasscode('@srcdir@/rrtype',
+        generate_typeclasscode('rrtype',
                                max(rdatadef_mtime, rdatahdr_mtime),
                                max(rdatadef_mtime, rdatahdr_mtime),
                                typecode2txt, 'Type')
                                typecode2txt, 'Type')
-        generate_typeclasscode('@srcdir@/rrclass', classdir_mtime,
+        generate_typeclasscode('rrclass', classdir_mtime,
                                classcode2txt, 'Class')
                                classcode2txt, 'Class')
-        generate_rrparam('@srcdir@/rrparamregistry', rdatahdr_mtime)
+        generate_rrparam('rrparamregistry', rdatahdr_mtime)
     except:
     except:
         sys.stderr.write('Code generation failed due to exception: %s\n' %
         sys.stderr.write('Code generation failed due to exception: %s\n' %
                          sys.exc_info()[1])
                          sys.exc_info()[1])