Commit 5602713f by Nils Goroll

Major overhaul of autocrap infrastructure and modernize varnish.m4 with varnish >= 4

- configure by pkg-config (new varnish4 / master standard - see vmod-example)
- make distcheck works now (working around dependency tracking issues with
  --disable-dependency-tracking )
- split out checks into a seperate subtree to ensure the build is complete
  before checking (parallel make wasn't working otherwise)
parent 274bf62b
......@@ -22,9 +22,8 @@ benchmark_results
/autom4te.cache/
/compile
/config.guess
/dcs_config.h
/dcs_config.h.in
/dcs_config.h.in~
/config.h
/config.h.in
/config.log
/config.status
/config.sub
......@@ -65,3 +64,5 @@ src/vcc_if.h
src/gen/dcs_classifier.checksum
src/*.rst
test-driver
dcs_classifier-*
src/gen/dbfile
if HAVE_VARNISH_M4
ACLOCAL_AMFLAGS = -I m4 -I ${LIBVARNISHAPI_DATAROOTDIR}/aclocal
else
ACLOCAL_AMFLAGS = -I m4
endif
# pass all given arguments
#
# --disable-dependency-tracking works around this issue which seems to
# be related to subdir-objects
DISTCHECK_CONFIGURE_FLAGS = \
DCS_KEY='$(DCS_KEY)' \
DCS_ACCOUNT='$(DCS_ACCOUNT)' \
DCS_DBFILE='$(DCS_DBFILE)' \
VMOD_DIR='$(VMOD_DIR)' \
VARNISHSRC='$(VARNISHSRC)' \
--disable-dependency-tracking
SUBDIRS = src
SUBDIRS = src check
dist_man_MANS = vmod_dcs.3
MAINTAINERCLEANFILES = $(dist_man_MANS)
......@@ -19,4 +36,4 @@ else
@false
endif
dist_data_DATA = dcs_config.h
dist_data_DATA = config.h
......@@ -242,7 +242,7 @@ above, the `VARNISHSRC` argument must be used as in
VARNISHSRC=/path/to/your/varnish/source/varnish-cache
Optionally, a custom vmod installation directory can be specified
using `VMODDIR=<dir>`
using `VMOD_DIR=<dir>`
When building the vmod, an additional
......
......@@ -35,10 +35,16 @@ else
esac
fi
# check for varnishapi.m4 in custom paths
dataroot=$(pkg-config --variable=datarootdir varnishapi 2>/dev/null)
# no error if this fails, we could be building for varnish2
if [ -z "${dataroot}" ] ; then
aclocal -I m4
else
aclocal -I m4 -I ${dataroot}/aclocal
fi
set -ex
$LIBTOOLIZE --copy --force
aclocal -I m4
autoheader
automake --add-missing --copy --foreign
autoconf
# check / Makefile.am
AUTOMAKE_OPTIONS = subdir-objects
VMOD_TESTS = $(srcdir)/@TESTDIR@/*.vtc
.PHONY: $(VMOD_TESTS)
$(srcdir)/@TESTDIR@/*.vtc:
@VARNISHTEST@ -Dvarnishd=@VARNISHD@ -Dvmod_topbuild=$(abs_top_builddir) $@
check: $(VMOD_TESTS)
EXTRA_DIST = \
$(VMOD_TESTS)
......@@ -43,7 +43,8 @@ dcs_test_SOURCES = \
# -
EXTRA_DIST = \
classes.conf
classes.conf \
dcs_demo.db
# included c source
if INSTALL_VARNISH2
......@@ -67,7 +68,7 @@ nodist_data_DATA = \
gen/dcs_type.c
endif
## varnish 3 vmod
## varnish 3/4 vmod
if BUILD_VMOD
......@@ -75,12 +76,12 @@ if BUILD_VMOD
# libvmod_dcs.so will include an own copy of the code without the
# overhead of library calls - at the cost of some memory overhead
vmoddir = $(VMODDIR)
vmoddir = $(VMOD_DIR)
vmod_LTLIBRARIES = libvmod_dcs.la
libvmod_dcs_la_CPPFLAGS = -Igen -I$(VARNISHSRC)/include -I$(VARNISHSRC)/bin/varnishd -I$(VARNISHSRC)
libvmod_dcs_la_CPPFLAGS = -Igen @VMOD_INCLUDES@
libvmod_dcs_la_LDFLAGS = -module -export-dynamic -avoid-version
libvmod_dcs_la_LDFLAGS = -module -export-dynamic -avoid-version -shared
libvmod_dcs_la_SOURCES = \
vmod_dcs.c
......@@ -89,31 +90,26 @@ nodist_libvmod_dcs_la_SOURCES = \
vcc_if.c \
vcc_if.h
vcc_if_INCLUDES = -I$(VARNISHSRC)/include -I$(VARNISHSRC)
libvmod_dcs.lo: dcs_varnish.c vcc_if.c vcc_if.h
vcc_dcs_INCLUDES = -I$(VARNISHSRC)/include -I$(VARNISHSRC)
#libvmod_dcs_la-vmod_dcs.lo: dcs_varnish.c vcc_if.c vcc_if.h
vcc_if.c vcc_if.h: @VMODTOOL@ @VCCFILE@
@PYTHON@ @VMODTOOL@ @VCCFILE@
vcc_if_INCLUDES = @VMOD_INCLUDES@
BUILT_SOURCES = \
vcc_if.c \
vcc_if.h
CLEANFILES = \
vcc_if.c \
vcc_if.h
vmod_dcs.rst vmod_dcs.man.rst vcc_if.c: vcc_if.h
VMOD_TESTS = @TESTDIR@/*.vtc
vcc_if.h: @VMODTOOL@ $(srcdir)/@VCCFILE@
@PYTHON@ @VMODTOOL@ $(srcdir)/@VCCFILE@
.PHONY: $(VMOD_TESTS)
@TESTDIR@/*.vtc: libvmod_dcs.la
$(VARNISHSRC)/bin/varnishtest/varnishtest -Dvarnishd=$(VARNISHSRC)/bin/varnishd/varnishd -Dvmod_topbuild=$(abs_top_builddir) $@
BUILT_SOURCES = \
vcc_if.c \
vcc_if.h \
vmod_dcs.rst \
vmod_dcs.man.rst
check: $(VMOD_TESTS)
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST += \
vmod_dcs.vcc \
$(VMOD_TESTS)
endif
@VCCFILE@
endif # BUILD_VMOD
......@@ -28,7 +28,7 @@
*
*/
#include "dcs_config.h"
#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include "dcs_match.h"
......
......@@ -28,7 +28,7 @@
*
*/
#include "dcs_config.h"
#include "config.h"
#ifdef DEBUG_K_MATCH
#include <stdlib.h>
......
......@@ -28,7 +28,7 @@
*
*/
#include "dcs_config.h"
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
......
......@@ -28,7 +28,7 @@
*
*/
#include "dcs_config.h"
#include "config.h"
#include "dcs_varnish.c"
......
......@@ -4,19 +4,33 @@ BUILT_SOURCES = \
dcs_classifier.c \
dcs_classifier.h \
dcs_type.c \
dcs_match_mem.h
dcs_match_mem.h \
dbfile
EXTRA_DIST = \
gen_dcs_classifier.pl \
gen_dcs_match_mem.c
if DCS_DBFILE_ABS
dbfile: @DCS_DBFILE@
- rm $@
ln -s $< $@
else
dbfile: $(abs_top_srcdir)/src/@DCS_DBFILE@
- rm $@
ln -s $< $@
endif
# -- the classifier
dcs_classifier.c dcs_classifier.h dcs_type.c: gen_dcs_classifier.pl $(DCS_DBFILE) ../classes.conf
# serialize build
dcs_classifier.checksum dcs_classifier.h dcs_type.c: dcs_classifier.c
dcs_classifier.c: $(srcdir)/gen_dcs_classifier.pl dbfile $(srcdir)/../classes.conf
if [[ -f fixup.remove ]] && [[ -f fixup.reorder ]] ; then \
./gen_dcs_classifier.pl $(DCS_DBFILE) $(DCS_KEY) ../classes.conf fixup.remove fixup.reorder ; \
$(srcdir)/gen_dcs_classifier.pl dbfile $(DCS_KEY) $(srcdir)/../classes.conf fixup.remove fixup.reorder ; \
else \
./gen_dcs_classifier.pl $(DCS_DBFILE) $(DCS_KEY) ../classes.conf ; \
$(srcdir)/gen_dcs_classifier.pl dbfile $(DCS_KEY) $(srcdir)/../classes.conf ; \
fi
# -- gen_dcs_match_mem
......@@ -31,7 +45,9 @@ dcs_match_mem.h: gen_dcs_match_mem
./gen_dcs_match_mem >dcs_match_mem.h
# -- fixup db
fixup.remove fixup.reorder fixup.out:
fixup.remove fixup.reorder: fixup.out
fixup.out:
- rm fixup.remove fixup.reorder fixup.out
- rm dcs_classifier.c dcs_classifier.h dcs_type.c
$(MAKE) $(AM_MAKEFLAGS) dcs_classifier.c dcs_classifier.h dcs_type.c
......@@ -94,5 +110,6 @@ CLEANFILES = \
fixup.reorder \
fixup.out \
dcs.db \
dcs.db.tstamp
dcs.db.tstamp \
dbfile \
dcs_classifier.checksum
......@@ -1393,7 +1393,7 @@ dcs_register_subkey_match(struct dcs_matchstate *state, dcs_subkey_id_t subkey_i
EOF
_VCL (F_TYPE_C, VCL_TOP, <<'EOF');
#include "dcs_config.h"
#include "config.h"
#include <errno.h>
......
......@@ -28,7 +28,7 @@
*
*/
#include "dcs_config.h"
#include "config.h"
#include <stdio.h>
......
......@@ -28,7 +28,7 @@
*
*/
#include "dcs_config.h"
#include "config.h"
#include "vrt.h"
#include "vcc_if.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment