[master] 01689b9 autogen.des / vtest.sh : support out-of-tree builds

Nils Goroll nils.goroll at uplex.de
Wed Dec 7 13:56:04 CET 2016


commit 01689b987ebfffdc0b4e01af59406840a7d6fc61
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Dec 7 12:36:49 2016 +0100

    autogen.des / vtest.sh : support out-of-tree builds
    
    ... which revealed that they actually fail atm, so another fix will be coming up

diff --git a/autogen.des b/autogen.des
index d98980d..6b75a76 100755
--- a/autogen.des
+++ b/autogen.des
@@ -2,6 +2,8 @@
 #
 # Use this when doing code development
 
+SRCDIR=${SRCDIR:-.}
+
 set -ex
 
 make -k distclean > /dev/null 2>&1 || true
@@ -21,7 +23,7 @@ else
 fi
 
 rm -f configure
-. ./autogen.sh 2>&1 | egrep -v "(subdir-objects|is in a subdirectory)"
+(cd $SRCDIR && . ./autogen.sh 2>&1 | egrep -v "(subdir-objects|is in a subdirectory)")
 
 # autoconf prior to 2.62 has issues with zsh 4.2 and newer
 export CONFIG_SHELL=/bin/sh
@@ -29,7 +31,7 @@ export CONFIG_SHELL=/bin/sh
 # NB: Workaround for make distcheck not working with
 # NB: FreeBSD's make on -current
 # env MAKE=gmake \
-./configure \
+$SRCDIR/configure \
     $DST \
     --enable-developer-warnings \
     --enable-debugging-symbols \
diff --git a/tools/vtest.sh b/tools/vtest.sh
index cf605f8..ea5b791 100755
--- a/tools/vtest.sh
+++ b/tools/vtest.sh
@@ -48,6 +48,9 @@ MAXRUNS="${MAXRUNS:-0}"
 
 SSH_DST="-p 203 vtest at varnish-cache.org"
 
+export SRCDIR=`pwd`/varnish-cache
+export BUILDDIR=${BUILDDIR:-${SRCDIR}}
+
 #######################################################################
 
 if ! (cd varnish-cache 2>/dev/null) ; then
@@ -62,14 +65,14 @@ fi
 
 autogen () (
 	set -e
-	cd varnish-cache
+	cd "${BUILDDIR}"
 	nice make distclean > /dev/null 2>&1 || true
-	nice sh autogen.des
+	nice sh "${SRCDIR}"/autogen.des
 )
 
 makedistcheck () (
 	set -e
-	cd varnish-cache
+	cd "${BUILDDIR}"
 	nice make distcheck
 )
 
@@ -82,7 +85,7 @@ failedtests () (
 			git log -n 1 ${t} | head -1
 		)
 		b=`basename ${t} .vtc`
-		for i in `find varnish-cache -name ${b}.log -print`
+		for i in `find "${BUILDDIR}" -name ${b}.log -print`
 		do
 			if [ -f ${i} ] ; then
 				mv ${i} "_report/_${b}.log"
@@ -142,6 +145,11 @@ do
 	waitnext=${WAITBAD}
 	orev=${rev}
 
+	if ! [ -d "${BUILDDIR}" ] && ! mkdir -p "${BUILDDIR}" ; then
+		echo >&1 "could not create BUILDDIR ${BUILDDIR}"
+		exit 2
+	fi
+
 	rm -rf _report
 	mkdir _report
 	export LOG=_report/_log



More information about the varnish-commit mailing list