[master] 448d26c Fix VPATH builds

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Mar 9 16:50:07 CET 2017


commit 448d26c345371df59eac997b4fdb2e727722f32f
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Mar 9 14:58:47 2017 +0100

    Fix VPATH builds
    
    We aren't building a vrt_test binary, it's a script. We also don't need
    to distribute vrt.c, the cost of a copy doesn't matter and it ensures
    that this file is always in the $(buildir). I also cleaned other wrong
    assumptions regarding $(srcdir) vs $(builddir).

diff --git a/include/Makefile.am b/include/Makefile.am
index 3075147..f6a08eb 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -131,18 +131,16 @@ CLEANFILES = \
 
 TESTS = vbm_test vrt_test
 
-noinst_PROGRAMS = ${TESTS}
+noinst_PROGRAMS = vbm_test
 
 vbm_test_SOURCES = vbm_test.c vbm.h
 
-vrt_test_SOURCES = vrt.c
-
 vrt.c: vrt.h
-	cp vrt.h vrt.c
+	cp $(srcdir)/vrt.h $@
 
 vrt_test: vrt.c
-	echo "exec ${CC} -c -o _vrt_test $(top_srcdir)/include/vrt.c" > vrt_test
-	chmod +x vrt_test
+	echo "exec ${CC} -c -o _vrt_test vrt.c" > $@
+	chmod +x $@
 
 test: ${TESTS}
 	@for test in ${TESTS} ; do ./$${test} ; done
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 4515940..fac8ee4 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -1417,7 +1417,7 @@ if i != "/* " + v + " */":
 	fo.write('#define VCS_Branch "%s"\n' % b)
 	fo.close()
 
-	for i in open(os.path.join(srcroot, "Makefile")):
+	for i in open(os.path.join(buildroot, "Makefile")):
 		if i[:14] == "PACKAGE_STRING":
 			break
 	i = i.split("=")[1].strip()



More information about the varnish-commit mailing list