chiark / gitweb /
Hacking to make out-of-tree builds work properly.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 26 Apr 2014 13:22:11 +0000 (14:22 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 9 Jun 2014 19:58:07 +0000 (20:58 +0100)
This is mostly standard.  The regression-test scripts have had an
interface enhancement: they will look for source-like files using the
$srcdir environment variable, which defaults to `.' for compatibility.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Makefile.in
client/Makefile.in
dynamic/Makefile.in
regress/Makefile.in
regress/checkall
regress/m1test
regress/r1test
src/Makefile.in

index 6e2e449..b0c64d1 100644 (file)
@@ -69,8 +69,8 @@ check:                        all
        $(MAKE) -C regress check
 
 README:                        README.html
-       lynx -dump -number_links -cfg=/dev/null ./README.html >README.tmp
-       mv -f README.tmp README
+       lynx -dump -number_links -cfg=/dev/null $(srcdir)/README.html >README.tmp
+       mv -f README.tmp $(srcdir)/README
 
 TAGS info dvi:
        # do nothing
index da0cdf1..01f2fcd 100644 (file)
@@ -30,11 +30,11 @@ PROGRAMS=   adnslogres adnsheloex adnshost $(PROGS_SYSDEP)
 PROGRAMS_LOCAL=        fanftest adnstest
 PROGRAMS_ALL=  $(PROGRAMS) $(PROGRAMS_LOCAL)
 
-STATIC_LIB=    $(ADNSDIR)/libadns.a
+STATIC_LIB=    ../src/libadns.a
 
 ifeq ($(ENABLE_DYNAMIC),elf)
-DYNAMIC_DEP=   $(srcdir)/../dynamic/$(SHLIBFILE)
-DYNAMIC_LINK=  -L$(srcdir)/../dynamic -ladns
+DYNAMIC_DEP=   ../dynamic/$(SHLIBFILE)
+DYNAMIC_LINK=  -L../dynamic -ladns
 DYNAMIC_SUFFIX=        _s
 else
 DYNAMIC_DEP=   $(STATIC_LIB)
@@ -45,15 +45,15 @@ endif
 TARG_INSTALL=  $(PROGRAMS)
 TARG_LOCAL=    $(addsuffix $(DYNAMIC_SUFFIX), $(PROGRAMS_ALL))
 TARGETS=       $(TARG_LOCAL) $(TARG_INSTALL)
-include                $(srcdir)/../settings.make
+include                ../settings.make
 
-DIRCFLAGS=     -I$(srcdir)/../src
+ADNSDIR=       $(srcdir)/../src
+DIRCFLAGS=     -I. -I../src -I$(ADNSDIR)
 
 TARG_OBJS=     $(addsuffix .o, $(PROGRAMS_ALL))
 ADH_OBJS=      adh-main.o adh-opts.o adh-query.o
 ALL_OBJS=      $(ADH_OBJS) $(TARG_OBJS)
 
-ADNSDIR=       $(srcdir)/../src/
 
 all:           $(TARGETS)
 
@@ -72,7 +72,7 @@ adnshost_s:   $(ADH_OBJS) $(STATIC_LIB)
                $(CC) $(LDFLAGS) $(ADH_OBJS) $(STATIC_LIB) -o $@ $(LDLIBS)
 
 $(ADH_OBJS):           adnshost.h
-$(ALL_OBJS):           $(ADNSDIR)/adns.h $(ADNSDIR)/config.h
+$(ALL_OBJS):           $(ADNSDIR)/adns.h ../src/config.h
 adnsresfilter.o:       $(ADNSDIR)/tvarith.h
 
 %:             %.o $(DYNAMIC_DEP)
index f26fe7d..59b6bbd 100644 (file)
@@ -24,7 +24,7 @@ srcdir=               @srcdir@
 VPATH=         @srcdir@
 
 TARGETS=       $(SHLIBFILE) $(SHLIBSONAME) $(SHLIBFORLINK)
-include                $(srcdir)/../settings.make
+include                ../settings.make
 include                $(srcdir)/../src/adns.make
 
 ALLOBJS=       $(addsuffix _p.o, $(basename $(LIBOBJS)))
@@ -49,7 +49,7 @@ $(SHLIBFILE): $(ALLOBJS)
                $(MKSHLIB_1) $@ $(MKSHLIB_2) $(ALLOBJS) $(LDLIBS) $(MKSHLIB_3)
 
 %_p.o:         $(srcdir)/../src/%.c $(srcdir)/../src/adns.h \
-                       $(srcdir)/../src/internal.h $(srcdir)/../src/config.h
-               $(SHLIBCC) -I$(srcdir)/../src -c -o $@ $<
+                       $(srcdir)/../src/internal.h ../src/config.h
+               $(SHLIBCC) -I. -I../src -I$(srcdir)/../src -c -o $@ $<
 
 $(LIBOBJS):    
index d41cf29..7428965 100644 (file)
@@ -28,10 +28,10 @@ PROGS_SYSDEP=       @PROGS_HAVE_TSEARCH@
 CLIENTS=       adnstest adnshost adnslogres $(PROGS_SYSDEP)
 AUTOCHDRS=     harness.h hsyscalls.h hredirect.h
 AUTOCSRCS=     hrecord.c hplayback.c hcommon.c
-include                $(srcdir)/../settings.make
+include                ../settings.make
 include                $(srcdir)/../src/adns.make
 
-DIRCFLAGS=     -I$(srcdir)/../src
+DIRCFLAGS=     -I../src -I$(srcdir) -I$(srcdir)/../src
 
 HCPPFLAGS=     -DADNS_REGRESS_TEST -I.
 
@@ -46,7 +46,7 @@ ALL_OBJS=     $(HARNLOBJS) dtest.o hrecord.o hplayback.o
 all install uninstall: $(TARGETS)
 
 check:         $(TARGETS)
-               ./checkall
+               srcdir=$(srcdir) $(srcdir)/checkall
 
 LINK_CMD=      $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
 
@@ -70,6 +70,6 @@ $(ALL_OBJS):  harness.h hsyscalls.h
 $(ADH_OBJS):   $(srcdir)/../client/adnshost.h
 
 %::    %.m4 hmacros.i4 hsyscalls.i4
-       $(M4) -P $< >$@-a.new
+       $(M4) -P -I$(srcdir) $< >$@-a.new
        sed -e 's/hm_comma/,/g; s/hm_squote/'\''/g; /^[  ]*$$/d' <$@-a.new >$@-b.new
-       @mv -f $@-b.new $@; rm -f $@-a.new
+       @mv -f $@-b.new $(srcdir)/$@; rm -f $@-a.new
index 4e02b57..c63a294 100755 (executable)
 
 set -e
 
+: ${srcdir=.}
 failed=''
 passed=''
 skipped=''
 
-for f in case-*.sys
+for f in $srcdir/case-*.sys
 do
-       case="`echo \"$f\" | sed -e 's/^case-//; s/\.sys$//'`"
+       case="`echo \"$f\" | sed -e 's:^.*/::; s/^case-//; s/\.sys$//'`"
        set +e
-       ./r1test $case
+       $srcdir/r1test $case
        rc=$?
        set -e
        case $rc in
index 6ecbdb3..493db0b 100755 (executable)
@@ -24,6 +24,7 @@
 
 set -e
 
+: ${srcdir=.}
 if [ $# -lt 3 ]
 then
        echo >&2 \
@@ -33,7 +34,7 @@ then
        exit 1
 fi
 
-case="case-$1"; shift
+case="$srcdir/case-$1"; shift
 initfile="$1"; shift
 
 hrecord="./adnstest_record"
@@ -64,8 +65,8 @@ fi
 
 queryargs="$*"
 
-initstring="`cat init-$initfile.text`"
-xinitflagsf=$program-xinitflags.text
+initstring="`cat $srcdir/init-$initfile.text`"
+xinitflagsf=$srcdir/$program-xinitflags.text
 if test -f $xinitflagsf
 then
        useinitflags="$initflags $(cat $xinitflagsf)";
index 1d5aca8..d981b45 100755 (executable)
 #  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 
 set -e
+: ${srcdir=.}
 mrc=1
 trap 'exit $mrc' 0
 
 casename="$1"
-case="case-$casename"
+case="$srcdir/case-$casename"
 ocase="output-$casename"
 
 exec 4<"$case.sys"
 read <&4 program initfile initflags
 read <&4 queryargs
 
-initstring="`cat init-$initfile.text`"
-xinitflagsf=$program-xinitflags.text
+initstring="`cat $srcdir/init-$initfile.text`"
+xinitflagsf=$srcdir/$program-xinitflags.text
 if test -f $xinitflagsf
 then
        initflags="$initflags `cat $xinitflagsf`";
index 7a7d055..a28dda3 100644 (file)
@@ -24,8 +24,10 @@ srcdir=              @srcdir@
 VPATH=         @srcdir@
 
 TARGETS=       libadns.a
-include                $(srcdir)/../settings.make
-include                adns.make
+include                ../settings.make
+include                $(srcdir)/adns.make
+
+DIRCFLAGS=     -I. -I$(srcdir)
 
 install:
                mkdir -p $(libdir) $(includedir)