From 76e772c27605f1a9966aab0135f161e3ec7e74bc Mon Sep 17 00:00:00 2001 From: Charlie Schluting Date: Thu, 30 Aug 2012 16:01:34 -0700 Subject: [PATCH 1/2] make it work both manually, and with defaults based on building as part of varnish (where we've included this as a subtree in varnish's lib/ dir) --- src/Makefile.am | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 6353abe..38b289c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,17 @@ -INCLUDES = -I$(VARNISHSRC)/include -I$(VARNISHSRC) +ifdef $(VARNISHSRC): + SRC = $(VARNISHSRC) + DIR_PREFIX = / +else: + SRC = $(top_srcdir) + DIR_PREFIX = lib/libvmod-timers/ + +INCLUDES = -I$(SRC)/include -I$(SRC) + +ifdef $(VMODDIR): + vmoddir = $(VMODDIR) +else: + vmoddir = $(pkglibdir)/vmods -vmoddir = $(VMODDIR) vmod_LTLIBRARIES = libvmod_statsd.la libvmod_statsd_la_LDFLAGS = -module -export-dynamic -avoid-version @@ -10,14 +21,14 @@ libvmod_statsd_la_SOURCES = \ vcc_if.h \ vmod_statsd.c -vcc_if.c vcc_if.h: $(VARNISHSRC)/lib/libvmod_std/vmod.py $(top_srcdir)/src/vmod_statsd.vcc - @PYTHON@ $(VARNISHSRC)/lib/libvmod_std/vmod.py $(top_srcdir)/src/vmod_statsd.vcc +vcc_if.c vcc_if.h: $(SRC)/lib/libvmod_std/vmod.py $(top_srcdir)/$(DIR_PREFIX)src/vmod_statsd.vcc + @PYTHON@ $(SRC)/lib/libvmod_std/vmod.py $(top_srcdir)/$(DIR_PREFIX)src/vmod_statsd.vcc VMOD_TESTS = tests/*.vtc .PHONY: $(VMOD_TESTS) tests/*.vtc: - $(VARNISHSRC)/bin/varnishtest/varnishtest -Dvarnishd=$(VARNISHSRC)/bin/varnishd/varnishd -Dvmod_topbuild=$(abs_top_builddir) $@ + $(SRC)/bin/varnishtest/varnishtest -Dvarnishd=$(top_srcdir)/bin/varnishd/varnishd -Dvmod_topbuild=$(abs_top_builddir) $@ check: $(VMOD_TESTS) From d738880f76aec590d4611605ad6df153e43fafaf Mon Sep 17 00:00:00 2001 From: Charlie Schluting Date: Thu, 30 Aug 2012 16:06:03 -0700 Subject: [PATCH 2/2] adding docs --- src/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index 38b289c..caa7fed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,7 @@ +# if VARNISHSRC is defined on the command-line, use that. Otherwise, build +# this the same as the modules that come with varnish (i.e. we're building +# within the varnish src dir itself, and $(top_srcdir) is the varnish source). +# ifdef $(VARNISHSRC): SRC = $(VARNISHSRC) DIR_PREFIX = /