diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in index 089e0a52dc..e3cfa64f4d 100644 --- a/bin/named/Makefile.in +++ b/bin/named/Makefile.in @@ -7,6 +7,7 @@ CINCLUDES = -I${srcdir}/../../lib/isc/unix/include \ -I${srcdir}/../../lib/isc/pthreads/include \ -I${srcdir}/../../lib/isc/include \ -I${srcdir}/../../lib/dns/include \ + -I../../lib/dns/include \ -I${srcdir}/../.. \ -I${srcdir} @@ -19,7 +20,6 @@ DEPLIBS = ../../lib/dns/libdns.a \ LIBS = ${DEPLIBS} \ @LIBS@ -# -ly -ll TARGETS = named @@ -28,8 +28,9 @@ OBJS = server.o udpclient.o tcpclient.o wire_debug.o wire_test.o @BIND9_MAKE_RULES@ -wire_test.o: ../tests/wire_test.c - ${CC} -c -o wire_test.o -DNOMAIN ${CINCLUDES} ${CFLAGS} ../tests/wire_test.c +wire_test.o: ${srcdir}/../tests/wire_test.c + ${CC} -c -o wire_test.o -DNOMAIN ${ALL_CFLAGS} \ + ${srcdir}/../tests/wire_test.c named: ${OBJS} ${DEPLIBS} ${CC} -o $@ ${OBJS} ${LIBS} diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index 08abf551ba..c48cc5a288 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -6,7 +6,9 @@ top_srcdir = @top_srcdir@ CINCLUDES = -I${srcdir}/../../lib/isc/unix/include \ -I${srcdir}/../../lib/isc/pthreads/include \ -I${srcdir}/../../lib/isc/include \ - -I${srcdir}/../../lib/dns/include + -I${srcdir}/../../lib/dns/include \ + -I../../lib/dns/include + CDEFINES = CWARNINGS = diff --git a/configure b/configure index 581f0fde3d..c0a920c0d8 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.16 +# From configure.in Revision: 1.18 # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.12 @@ -1717,7 +1717,10 @@ EOF esac -BIND9_MAKE_RULES=$srcdir/make/rules +BIND9_TOP_BUILDDIR=`pwd` + + +BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules BIND9_VERSION=$srcdir/version @@ -1887,6 +1890,7 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g s%@STD_CINCLUDES@%$STD_CINCLUDES%g s%@STD_CDEFINES@%$STD_CDEFINES%g s%@STD_CWARNINGS@%$STD_CWARNINGS%g +s%@BIND9_TOP_BUILDDIR@%$BIND9_TOP_BUILDDIR%g /@BIND9_MAKE_RULES@/r $BIND9_MAKE_RULES s%@BIND9_MAKE_RULES@%%g /@BIND9_VERSION@/r $BIND9_VERSION diff --git a/configure.in b/configure.in index 3b4cfc66fe..ef85559293 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ -AC_REVISION($Revision: 1.17 $) +AC_REVISION($Revision: 1.18 $) AC_INIT(lib/dns/name.c) AC_CONFIG_HEADER(config.h) @@ -124,8 +124,11 @@ case "$host" in ;; esac +AC_SUBST(BIND9_TOP_BUILDDIR) +BIND9_TOP_BUILDDIR=`pwd` + AC_SUBST_FILE(BIND9_MAKE_RULES) -BIND9_MAKE_RULES=$srcdir/make/rules +BIND9_MAKE_RULES=$BIND9_TOP_BUILDDIR/make/rules AC_SUBST_FILE(BIND9_VERSION) BIND9_VERSION=$srcdir/version diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in index c191a62981..8f98b78a08 100644 --- a/lib/dns/Makefile.in +++ b/lib/dns/Makefile.in @@ -8,7 +8,11 @@ top_srcdir = @top_srcdir@ CINCLUDES = -I${srcdir}/../isc/unix/include \ -I${srcdir}/../isc/pthreads/include \ -I${srcdir}/../isc/include \ - -I${srcdir}/include + -I${srcdir}/include \ + -I${srcdir} \ + -I./include \ + -I. + CDEFINES = CWARNINGS = @@ -45,13 +49,13 @@ clean distclean:: rdata.o: code.h include/dns/enumtype.h: gen - ./gen -t > $@ + ./gen -s ${srcdir} -t > $@ include/dns/enumclass.h: gen - ./gen -c > $@ + ./gen -s ${srcdir} -c > $@ code.h: gen - ./gen > code.h + ./gen -s ${srcdir} > code.h gen: gen.c ${CC} ${ALL_CFLAGS} -o $@ $? diff --git a/lib/dns/gen.c b/lib/dns/gen.c index bb4422de60..b28c4016c1 100644 --- a/lib/dns/gen.c +++ b/lib/dns/gen.c @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: gen.c,v 1.13 1999/02/04 06:38:41 marka Exp $ */ + /* $Id: gen.c,v 1.14 1999/02/18 01:24:31 halley Exp $ */ #include @@ -104,7 +104,7 @@ struct tt { int type; char classname[11]; char typename[11]; - char dirname[sizeof "rdata/0123456789_65535" ]; + char dirname[256]; /* XXX Should be max path length */ } *types; char * upper(char *); @@ -221,7 +221,6 @@ add(int class, char *classname, int type, char *typename, char *dirname) { struct cc *newcc; struct cc *cc, *oldcc; - if (newtt == NULL) exit(1); @@ -313,7 +312,8 @@ sd(int class, char *classname, char *dir) { int main(int argc, char **argv) { DIR *d; - char buf[sizeof "rdata/0123456789_65535" ]; + char buf[256]; /* XXX Should be max path length */ + char srcdir[256]; /* XXX Should be max path length */ int class; char classname[11]; struct dirent *dp; @@ -329,7 +329,8 @@ main(int argc, char **argv) { int c; char buf1[11]; - while ((c = getopt(argc, argv, "ct")) != -1) + strcpy(srcdir, ""); + while ((c = getopt(argc, argv, "cts:")) != -1) switch (c) { case 'c': code = 0; @@ -341,11 +342,15 @@ main(int argc, char **argv) { class_enum = 0; type_enum = 1; break; + case 's': + sprintf(srcdir, "%s/", optarg); + break; case '?': exit(1); } - if ((d = opendir("rdata")) == NULL) + sprintf(buf, "%srdata", srcdir); + if ((d = opendir(buf)) == NULL) exit(1); while ((dp = readdir(d)) != NULL) { @@ -355,12 +360,13 @@ main(int argc, char **argv) { if ((class > 65535) || (class < 0)) continue; - sprintf(buf, "rdata/%s_%d", classname, class); - if (strcmp(buf + 6, dp->d_name) != 0) + sprintf(buf, "%srdata/%s_%d", srcdir, classname, class); + if (strcmp(buf + 6 + strlen(srcdir), dp->d_name) != 0) continue; sd(class, classname, buf); } - sd(0, "", "rdata/generic"); + sprintf(buf, "%srdata/generic", srcdir); + sd(0, "", buf); closedir(d); if (time(&now) != -1) { diff --git a/make/rules.in b/make/rules.in index 33f1e672d1..76222278f0 100644 --- a/make/rules.in +++ b/make/rules.in @@ -17,6 +17,8 @@ libdir = @libdir@ @SET_MAKE@ +top_builddir = @BIND9_TOP_BUILDDIR@ + ### ### All ### @@ -69,7 +71,7 @@ STD_CWARNINGS = @STD_CWARNINGS@ .SUFFIXES: .SUFFIXES: .c .o -ALWAYS_INCLUDES = -I${top_srcdir} +ALWAYS_INCLUDES = -I${top_builddir} ALWAYS_DEFINES = -D_REENTRANT ALWAYS_WARNINGS =