BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/70654


Change subject: fix up test/dist stuff
......................................................................

fix up test/dist stuff

This breaks away from varnish's example vmod build
process a bit, but the upside is now "make distcheck"
works, and it's possible to build the vmod without
first building the varnish source tree (assuming
there's an installed copy of varnish which matches
that source tree...).  It remains to be seen if
that's going to be enough to sanely build a debian
package by downloading matching varnish source.

Change-Id: I913cd254ac8c3dd860f15e291ab09e3e93773f28
---
M configure.ac
M src/Makefile.am
2 files changed, 23 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/software/varnish/libvmod-netmapper 
refs/changes/54/70654/1

diff --git a/configure.ac b/configure.ac
index 9813e97..2ecf063 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@
 AC_CANONICAL_SYSTEM
 AC_LANG(C)
 
-AM_INIT_AUTOMAKE([foreign])
+AM_INIT_AUTOMAKE([dist-xz no-dist-gzip foreign tar-ustar -Wall])
 
 AC_GNU_SOURCE
 AC_PROG_CC
@@ -51,20 +51,25 @@
        [AC_MSG_FAILURE(["$VARNISHSRC" is not a Varnish source directory])]
 )
 
-# Check that varnishtest is built in the varnish source directory
-AC_CHECK_FILE([$VARNISHSRC/bin/varnishtest/varnishtest],
+# varnishd and varnishtest locations (default from source tree)
+
+AC_ARG_VAR([VARNISHD], [path to varnishd binary (default: used built copy in 
VARNISHSRC)])
+if test "x$VARNISHD" = x; then
+    VARNISHD="$VARNISHSRC/bin/varnishd/varnishd"
+fi
+AC_CHECK_FILE([$VARNISHD],
        [],
-       [AC_MSG_FAILURE([Can't find "$VARNISHSRC/bin/varnishtest/varnishtest". 
Please build your varnish source directory])]
+    [AC_MSG_FAILURE([varnishd binary "$VARNISHD" does not exist])]
 )
 
-# vmod installation dir
-AC_ARG_VAR([VMODDIR], [vmod installation directory 
@<:@LIBDIR/varnish/vmods@:>@])
-if test "x$VMODDIR" = x; then
-       VMODDIR=`pkg-config --variable=vmoddir varnishapi`
-       if test "x$VMODDIR" = x; then
-               AC_MSG_FAILURE([Can't determine vmod installation directory])
-       fi
+AC_ARG_VAR([VARNISHTEST], [path to varnishtest binary (default: used built 
copy in VARNISHSRC)])
+if test "x$VARNISHTEST" = x; then
+    VARNISHTEST="$VARNISHSRC/bin/varnishtest/varnishtest"
 fi
+AC_CHECK_FILE([$VARNISHTEST],
+       [],
+    [AC_MSG_FAILURE([varnishtest binary "$VARNISHTEST" does not exist])]
+)
 
 # userspace-rcu for lockless netmap reload
 AC_CHECK_HEADER(urcu-qsbr.h,[
diff --git a/src/Makefile.am b/src/Makefile.am
index 2060ed8..a8e55d7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
-INCLUDES = -I$(VARNISHSRC)/include -I$(VARNISHSRC) -I$(srcdir)/nlt
+AM_CPPFLAGS = -I$(VARNISHSRC)/include -I$(VARNISHSRC) -I$(srcdir)/nlt
 
-vmoddir = $(VMODDIR)
+vmoddir = $(libdir)/varnish/vmods
 vmod_LTLIBRARIES = libvmod_netmapper.la
 
 libvmod_netmapper_la_LDFLAGS = -module -export-dynamic -avoid-version -shared
@@ -21,16 +21,15 @@
 vcc_if.c vcc_if.h: $(VARNISHSRC)/lib/libvmod_std/vmod.py 
$(top_srcdir)/src/vmod_netmapper.vcc
        @PYTHON@ $(VARNISHSRC)/lib/libvmod_std/vmod.py 
$(top_srcdir)/src/vmod_netmapper.vcc
 
+VMOD_TDATA = tests/*.json
 VMOD_TESTS = tests/*.vtc
-.PHONY: $(VMOD_TESTS)
+.PHONY: $(VMOD_TESTS) $(VMOD_TDATA)
 
-tests/*.vtc:
-       $(VARNISHSRC)/bin/varnishtest/varnishtest 
-Dvarnishd=$(VARNISHSRC)/bin/varnishd/varnishd 
-Dvmod_topbuild=$(abs_top_builddir) -Dvmod_topsrc=$(abs_top_srcdir) $@
+tests/*.vtc: libvmod_netmapper.la
+       $(VARNISHTEST) -Dvarnishd=$(VARNISHD) 
-Dvmod_topbuild=$(abs_top_builddir) -Dvmod_topsrc=$(abs_top_srcdir) $(srcdir)/$@
 
 check: $(VMOD_TESTS)
 
-EXTRA_DIST = \
-       vmod_netmapper.vcc \
-       $(VMOD_TESTS)
+EXTRA_DIST = vmod_netmapper.vcc $(VMOD_TESTS) $(VMOD_TDATA)
 
 CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h

-- 
To view, visit https://gerrit.wikimedia.org/r/70654
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I913cd254ac8c3dd860f15e291ab09e3e93773f28
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/varnish/libvmod-netmapper
Gerrit-Branch: master
Gerrit-Owner: BBlack <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to